CatalystX::Usul::Model::Config - Read and write configuration files


CatalystX-Usul documentation  | view source Contained in the CatalystX-Usul distribution.

Index


Name

Top

CatalystX::Usul::Model::Config - Read and write configuration files

Version

Top

0.3.$Revision: 576 $

Synopsis

Top

   use base qw(CatalystX::Usul::Model::Config);

Description

Top

Provides CRUD methods for read and write configuration files. For each schema a subclass is defined that inherits from this class

Subroutines/Methods

Top

new

The constructor sets up the ctrldir attribute which acts as a default directory if one is not supplied in the file name

build_per_context_instance

Creates a new CatalystX::Usul::File object and takes a copy of the stashed language

config_form

   $c->model( q(Config::*) )->config_form;

Creates the form to edit an element

add_to_attribute_list

   $c->model( q(Config::*) )->add_to_attribute_list( $args );

Add new items to an attribute list. The $args hash requires these keys; file the name of the file to edit, name the name of the element to edit, list the attribute of the named element containing the list of existing items, req the request object and field the field on the request object containing the list of new items

create

   $c->model( q(Config::*) )->create( $args );

Creates a new element. The $args hash requires these keys; file the name of the file to edit, name the name of the element to edit and fields is a hash containing the attributes of the new element. Missing attributes are defaulted from the defaults attribute of the CatalystX::Usul::File::Schema object

create_or_update

   $c->model( q(Config::*) )->create_or_update( $args );

Creates a new element if one does not exist or updates the existing one if it does exist

delete

   $c->model( q(Config::*) )->delete( $args );

Deletes an element

find

   $c->model( q(Config::*) )->find( $file, $name );

get_list

   $c->model( q(Config::*) )->get_list( $file, $name );

Retrieves the named element and a list of elements

load_files

   $config = eval { $c->model( q(Config) )->load_files( @{ $files } ) };

Loads the required configuration files. Returns a hash ref

remove_from_attribute_list

   $c->model( q(Config::*) )->remove_from_attribute_list( $args );

Removes items from an attribute list

   @elements = $c->model( q(Config::*) )->search( $args );

Searches the given file for elements matching the given criteria. Returns an array of element objects

update

   $c->model( q(Config::*) )->update( $args );

Updates the named element

Diagnostics

Top

None

Configuration and Environment

Top

None

Dependencies

Top

CatalystX::Usul::File::ResultSource
CatalystX::Usul::Model
CatalystX::Usul::Table

Incompatibilities

Top

There are no known incompatibilities in this module

Bugs and Limitations

Top

There are no known bugs in this module. Please report problems to the address below. Patches are welcome

Author

Top

Peter Flanigan, <Support at RoxSoft.co.uk>

License and Copyright

Top


CatalystX-Usul documentation  | view source Contained in the CatalystX-Usul distribution.