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

0.7.$Revision: 1181 $

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

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

The constructor sets up the ctrldir attribute which acts as a default directory if one is not supplied in the file name
Creates a new CatalystX::Usul::File object and takes a copy of the stashed language
$c->model( q(Config::*) )->config_form;
Creates the form to edit an element
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
$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
$c->model( q(Config::*) )->delete( $args );
Deletes an element
$c->model( q(Config::*) )->find( $ns, $name );
$c->model( q(Config::*) )->list( $ns, $name );
Retrieves the named element and a list of elements
$config = $c->model( q(Config) )->load( @{ $files } );
Loads the required configuration files. Returns a hash ref
$c->model( q(Config) )->load_per_request_config;
Loads the config data for the current request. The data is split across six files; one for OS dependant data, one for this phase (live, test, development etc.), default data and language dependant default data, data for the current controller and it's language dependant data. This information is cached
Data in the globals attribute is raised to the top level of the stash and the globals attribute deleted
$c->model( q(Config::*) )->push_attribute( $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
@elements = $c->model( q(Config::*) )->search( $args );
Searches the given file for elements matching the given criteria. Returns an array of element objects
$c->model( q(Config::*) )->splice_attribute( $args );
Removes items from an attribute list
Updates the named element
$bool = $c->model( q(Config::*) )->update_list( $namespace, $args );
Calls update_group_membership which will push/splice attributes to/from the selected list
Return a File::DataClass::ResultSet for the supplied file

None

None


There are no known incompatibilities in this module

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

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

Copyright (c) 2008 Peter Flanigan. All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic
This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE