.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Config::Model::Node 3pm" .TH Config::Model::Node 3pm "2014-09-24" "perl v5.20.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Config::Model::Node \- Class for configuration tree node .SH "VERSION" .IX Header "VERSION" version 2.061 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& use Config::Model; \& use Log::Log4perl qw(:easy); \& Log::Log4perl\->easy_init($WARN); \& \& # define configuration tree object \& my $model = Config::Model\->new; \& $model\->create_config_class( \& name => \*(AqOneConfigClass\*(Aq, \& class_description => "OneConfigClass detailed description", \& \& element => [ \& [qw/X Y Z/] => { \& type => \*(Aqleaf\*(Aq, \& value_type => \*(Aqenum\*(Aq, \& choice => [qw/Av Bv Cv/] \& } \& ], \& \& status => [ X => \*(Aqdeprecated\*(Aq ], \& description => [ X => \*(AqX\-ray description (can be long)\*(Aq ], \& summary => [ X => \*(AqX\-ray\*(Aq ], \& \& accept => [ \& \*(Aqip.*\*(Aq => { \& type => \*(Aqleaf\*(Aq, \& value_type => \*(Aquniline\*(Aq, \& summary => \*(Aqip address\*(Aq, \& } \& ] \& ); \& my $instance = $model\->instance (root_class_name => \*(AqOneConfigClass\*(Aq); \& my $root = $instance\->config_root ; \& \& # X is not shown below because of its deprecated status \& print $root\->describe,"\en" ; \& # name value type comment \& # Y [undef] enum choice: Av Bv Cv \& # Z [undef] enum choice: Av Bv Cv \& \& # add some data \& $root\->load( step => \*(AqY=Av\*(Aq ); \& \& # add some accepted element, ipA and ipB are created on the fly \& $root\->load( step => q!ipA=192.168.1.0 ipB=192.168.1.1"! ); \& \& # show also ip* element created in the last "load" call \& print $root\->describe,"\en" ; \& # name value type comment \& # Y Av enum choice: Av Bv Cv \& # Z [undef] enum choice: Av Bv Cv \& # ipA 192.168.1.0 uniline \& # ipB 192.168.1.1 uniline .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This class provides the nodes of a configuration tree. When created, a node object will get a set of rules that will define its properties within the configuration tree. .PP Each node contain a set of elements. An element can contain: .IP "\(bu" 4 A leaf element implemented with Config::Model::Value. A leaf can be plain (unconstrained value) or be strongly typed (values are checked against a set of rules). .IP "\(bu" 4 Another node. .IP "\(bu" 4 A collection of items: a list element, implemented with Config::Model::ListId. Each item can be another node or a leaf. .IP "\(bu" 4 A collection of identified items: a hash element, implemented with Config::Model::HashId. Each item can be another node or a leaf. .SH "Configuration class declaration" .IX Header "Configuration class declaration" A class declaration is made of the following parameters: .IP "\fBname\fR" 4 .IX Item "name" Mandatory \f(CW\*(C`string\*(C'\fR parameter. This config class name can be used by a node element in another configuration class. .IP "\fBclass_description\fR" 4 .IX Item "class_description" Optional \f(CW\*(C`string\*(C'\fR parameter. This description will be used when generating user interfaces. .IP "\fBelement\fR" 4 .IX Item "element" Mandatory \f(CW\*(C`list ref\*(C'\fR of elements of the configuration class : .Sp .Vb 3 \& element => [ foo => { type = \*(Aqleaf\*(Aq, ... }, \& bar => { type = \*(Aqleaf\*(Aq, ... } \& ] .Ve .Sp Element names can be grouped to save typing: .Sp .Vb 1 \& element => [ [qw/foo bar/] => { type = \*(Aqleaf\*(Aq, ... } ] .Ve .Sp See below for details on element declaration. .IP "\fBlevel\fR" 4 .IX Item "level" Optional \f(CW\*(C`list ref\*(C'\fR of the elements whose level are different from default value (\f(CW\*(C`normal\*(C'\fR). Possible values are \f(CW\*(C`important\*(C'\fR, \f(CW\*(C`normal\*(C'\fR or \f(CW\*(C`hidden\*(C'\fR. .Sp The level is used to set how configuration data is presented to the user in browsing mode. \f(CW\*(C`Important\*(C'\fR elements will be shown to the user no matter what. \f(CW\*(C`hidden\*(C'\fR elements will be explained with the \fIwarp\fR notion. .Sp .Vb 1 \& level => [ [qw/X Y/] => \*(Aqimportant\*(Aq ] .Ve .IP "\fBstatus\fR" 4 .IX Item "status" Optional \f(CW\*(C`list ref\*(C'\fR of the elements whose status are different from default value (\f(CW\*(C`standard\*(C'\fR). Possible values are \f(CW\*(C`obsolete\*(C'\fR, \&\f(CW\*(C`deprecated\*(C'\fR or \f(CW\*(C`standard\*(C'\fR. .Sp Using a deprecated element will issue a warning. Using an obsolete element will raise an exception (See Config::Model::Exception. .Sp .Vb 1 \& status => [ [qw/X Y/] => \*(Aqobsolete\*(Aq ] .Ve .IP "\fBdescription\fR" 4 .IX Item "description" Optional \f(CW\*(C`list ref\*(C'\fR of element description. These descriptions will be used when generating user interfaces. .IP "\fBdescription\fR" 4 .IX Item "description" Optional \f(CW\*(C`list ref\*(C'\fR of element summary. These descriptions will be used when generating user interfaces or as comment when writing configuration files. .IP "\fBread_config\fR" 4 .IX Item "read_config" .PD 0 .IP "\fBwrite_config\fR" 4 .IX Item "write_config" .IP "\fBconfig_dir\fR" 4 .IX Item "config_dir" .PD Parameters used to load on demand configuration data. See Config::Model::BackendMgr for details. .IP "\fBaccept\fR" 4 .IX Item "accept" Optional list of criteria (i.e. a regular expression to match ) to accept unknown parameters. Each criteria will have a list of specification that will enable \f(CW\*(C`Config::Model\*(C'\fR to create a model snippet for the unknown element. .Sp Example: .Sp .Vb 10 \& accept => [ \& \*(Aqlist.*\*(Aq => { \& type => \*(Aqlist\*(Aq, \& cargo => { \& type => \*(Aqleaf\*(Aq, \& value_type => \*(Aqstring\*(Aq, \& }, \& }, \& \*(Aqstr.*\*(Aq => { \& type => \*(Aqleaf\*(Aq, \& value_type => \*(Aquniline\*(Aq \& }, \& ] .Ve .Sp All \f(CW\*(C`element\*(C'\fR parameters can be used in specifying accepted parameters. .Sp The parameter \f(CW\*(C`accept_after\*(C'\fR to specify where to insert the accepted element. This will not change much the behavior of the tree, but it will help generate user interface easier to use. .Sp Example: .Sp .Vb 10 \& element => [ \& \*(AqBug\*(Aq => { type => \*(Aqleaf\*(Aq, value_type => \*(Aquniline\*(Aq } , \& ] \& accept => [ \& \*(AqBug\-.*\*(Aq => { \& value_type => \*(Aquniline\*(Aq, \& type => \*(Aqleaf\*(Aq \& accept_after => \*(AqBug\*(Aq , \& } \& ] .Ve .Sp The model snippet above will ensure that \f(CW\*(C`Bug\-Debian\*(C'\fR will be shown right after \f(CW\*(C`bug\*(C'\fR. .SH "Element declaration" .IX Header "Element declaration" .SS "Element type" .IX Subsection "Element type" Each element is declared with a list ref that contains all necessary information: .PP .Vb 3 \& element => [ \& foo => { ... } \& ] .Ve .PP This most important information from this hash ref is the mandatory \&\fBtype\fR parameter. The \fItype\fR type can be: .ie n .IP """node""" 8 .el .IP "\f(CWnode\fR" 8 .IX Item "node" The element is a simple node of a tree instantiated from a configuration class (declared with \&\*(L"create_config_class( ... )\*(R" in Config::Model). See \*(L"Node element\*(R". .ie n .IP """warped_node""" 8 .el .IP "\f(CWwarped_node\fR" 8 .IX Item "warped_node" The element is a node whose properties (mostly \f(CW\*(C`config_class_name\*(C'\fR) can be changed (warped) according to the values of one or more leaf elements in the configuration tree. See Config::Model::WarpedNode for details. .ie n .IP """leaf""" 8 .el .IP "\f(CWleaf\fR" 8 .IX Item "leaf" The element is a scalar value. See \*(L"Leaf element\*(R" .ie n .IP """hash""" 8 .el .IP "\f(CWhash\fR" 8 .IX Item "hash" The element is a collection of nodes or values (default). Each element of this collection is identified by a string (Just like a regular hash, except that you can set up constraint of the keys). See \*(L"Hash element\*(R" .ie n .IP """list""" 8 .el .IP "\f(CWlist\fR" 8 .IX Item "list" The element is a collection of nodes or values (default). Each element of this collection is identified by an integer (Just like a regular perl array, except that you can set up constraint of the keys). See \&\*(L"List element\*(R" .ie n .IP """check_list""" 8 .el .IP "\f(CWcheck_list\fR" 8 .IX Item "check_list" The element is a collection of values which are unique in the check_list. See CheckList. .SS "Node element" .IX Subsection "Node element" When declaring a \f(CW\*(C`node\*(C'\fR element, you must also provide a \&\f(CW\*(C`config_class_name\*(C'\fR parameter. For instance: .PP .Vb 10 \& $model \->create_config_class \& ( \& name => "ClassWithOneNode", \& element => [ \& the_node => { \& type => \*(Aqnode\*(Aq, \& config_class_name => \*(AqAnotherClass\*(Aq, \& }, \& ] \& ) ; .Ve .SS "Leaf element" .IX Subsection "Leaf element" When declaring a \f(CW\*(C`leaf\*(C'\fR element, you must also provide a \&\f(CW\*(C`value_type\*(C'\fR parameter. See Config::Model::Value for more details. .SS "Hash element" .IX Subsection "Hash element" When declaring a \f(CW\*(C`hash\*(C'\fR element, you must also provide a \&\f(CW\*(C`index_type\*(C'\fR parameter. .PP You can also provide a \f(CW\*(C`cargo_type\*(C'\fR parameter set to \f(CW\*(C`node\*(C'\fR or \&\f(CW\*(C`leaf\*(C'\fR (default). .PP See Config::Model::HashId and Config::Model::AnyId for more details. .SS "List element" .IX Subsection "List element" You can also provide a \f(CW\*(C`cargo_type\*(C'\fR parameter set to \f(CW\*(C`node\*(C'\fR or \&\f(CW\*(C`leaf\*(C'\fR (default). .PP See Config::Model::ListId and Config::Model::AnyId for more details. .SH "Introspection methods" .IX Header "Introspection methods" .SS "name" .IX Subsection "name" Returns the location of the node, or its config class name (for root node). .SS "get_type" .IX Subsection "get_type" Returns \f(CW\*(C`node\*(C'\fR. .SS "config_model" .IX Subsection "config_model" Returns the \fBentire\fR configuration model (Config::Model object). .SS "model" .IX Subsection "model" Returns the configuration model of this node (data structure). .SS "config_class_name" .IX Subsection "config_class_name" Returns the configuration class name of this node. .SS "instance" .IX Subsection "instance" Returns the instance object containing this node. Inherited from Config::Model::AnyThing .SS "has_element ( name => element_name, [ type => searched_type ] )" .IX Subsection "has_element ( name => element_name, [ type => searched_type ] )" Returns 1 if the class model has the element declared or if the element name is matched by the optional \f(CW\*(C`accept\*(C'\fR parameter. If \f(CW\*(C`type\*(C'\fR is specified, the element name must also match the type. .SS "find_element ( element_name , [ case => any ])" .IX Subsection "find_element ( element_name , [ case => any ])" Returns \f(CW$name\fR if the class model has the element declared or if the element name is matched by the optional \f(CW\*(C`accept\*(C'\fR parameter. .PP If case is set to any, has_element will return the element name who match the passed name in a case-insensitive manner. .PP Returns empty if no matching element is found. .SS "model_searcher ()" .IX Subsection "model_searcher ()" Returns an object dedicated to search an element in the configuration model (respecting privilege level). .PP This method returns a Config::Model::SearchElement object. See Config::Model::SearchElement for details on how to handle a search. .PP This method is inherited from Config::Model::AnyThing. .SS "element_model ( element_name )" .IX Subsection "element_model ( element_name )" Returns model of the element. .SS "element_type ( element_name )" .IX Subsection "element_type ( element_name )" Returns the type (e.g. leaf, hash, list, checklist or node) of the element. .SS "\fIelement_name()\fP" .IX Subsection "element_name()" Returns the element name that contain this object. Inherited from Config::Model::AnyThing .SS "\fIindex_value()\fP" .IX Subsection "index_value()" See \*(L"\fIindex_value()\fR\*(R" in Config::Model::AnyThing .SS "\fIparent()\fP" .IX Subsection "parent()" See \*(L"\fIparent()\fR\*(R" in Config::Model::AnyThing .SS "\fIroot()\fP" .IX Subsection "root()" See \*(L"\fIroot()\fR\*(R" in Config::Model::AnyThing .SS "\fIlocation()\fP" .IX Subsection "location()" See \*(L"\fIlocation()\fR\*(R" in Config::Model::AnyThing .SH "Element property management" .IX Header "Element property management" .SS "get_element_name ( ... )" .IX Subsection "get_element_name ( ... )" Return all elements names available. .PP Optional parameters are: .IP "\(bu" 4 \&\fBtype\fR: Returns only element of requested type (e.g. \f(CW\*(C`list\*(C'\fR, \&\f(CW\*(C`hash\*(C'\fR, \f(CW\*(C`leaf\*(C'\fR,...). By default return elements of any type. .IP "\(bu" 4 \&\fBcargo_type\fR: Returns only element which contain requested type. E.g. if \f(CW\*(C`get_element_name\*(C'\fR is called with \f(CW\*(C`cargo_type => leaf\*(C'\fR, \&\f(CW\*(C`get_element_name\*(C'\fR will return simple leaf elements, but also hash or list element that contain leaf object. By default return elements of any type. .IP "\(bu" 4 \&\fBcheck\fR: \f(CW\*(C`yes\*(C'\fR, \f(CW\*(C`no\*(C'\fR or \f(CW\*(C`skip\*(C'\fR .PP Returns an array in array context, and a string (e.g. \f(CW\*(C`join(\*(Aq \*(Aq,@array)\*(C'\fR) in scalar context. .SS "children" .IX Subsection "children" Like get_element_name without parameters. Returns the list of elements. This method is polymorphic for all non-leaf objects of the configuration tree. .SS "next_element ( ... )" .IX Subsection "next_element ( ... )" This method provides a way to iterate through the elements of a node. Mandatory parameter is \f(CW\*(C`name\*(C'\fR. Optional parameter: \f(CW\*(C`status\*(C'\fR. .PP Returns the next element name for status (default \f(CW\*(C`normal\*(C'\fR). Returns undef if no next element is available. .SS "previous_element ( name => element_name )" .IX Subsection "previous_element ( name => element_name )" This method provides a way to iterate through the elements of a node. .PP Returns the previous element name. Returns undef if no previous element is available. .SS "get_element_property ( element => ..., property => ... )" .IX Subsection "get_element_property ( element => ..., property => ... )" Retrieve a property of an element. .PP I.e. for a model : .PP .Vb 2 \& status => [ X => \*(Aqdeprecated\*(Aq ] \& element => [ X => { ... } ] .Ve .PP This call will return \f(CW\*(C`deprecated\*(C'\fR: .PP .Vb 1 \& $node\->get_element_property ( element => \*(AqX\*(Aq, property => \*(Aqstatus\*(Aq ) .Ve .SS "set_element_property ( element => ..., property => ... )" .IX Subsection "set_element_property ( element => ..., property => ... )" Set a property of an element. .SS "reset_element_property ( element => ... )" .IX Subsection "reset_element_property ( element => ... )" Reset a property of an element according to the original model. .SH "Information management" .IX Header "Information management" .SS "fetch_element ( name => .. , [ check => ..] )" .IX Subsection "fetch_element ( name => .. , [ check => ..] )" Fetch and returns an element from a node. .PP check can be set to yes, no or skip. When check is \f(CW\*(C`no\*(C'\fR or \f(CW\*(C`skip\*(C'\fR, can return \f(CW\*(C`undef\*(C'\fR when the element is unknown, or 0 if the element is not available (hidden). .SS "fetch_element_value ( name => ... [ check => ...] )" .IX Subsection "fetch_element_value ( name => ... [ check => ...] )" Fetch and returns the \fIvalue\fR of a leaf element from a node. .SS "store_element_value ( name, value )" .IX Subsection "store_element_value ( name, value )" Store a \fIvalue\fR in a leaf element from a node. .PP Can be invoked with named parameters (name, value, check) .SS "is_element_available( name => ..., )" .IX Subsection "is_element_available( name => ..., )" Returns 1 if the element \f(CW\*(C`name\*(C'\fR is available and if the element is not \*(L"hidden\*(R". Returns 0 otherwise. .PP As a syntactic sugar, this method can be called with only one parameter: .PP .Vb 1 \& is_element_available( \*(Aqelement_name\*(Aq ) ; .Ve .SS "accept_element( name )" .IX Subsection "accept_element( name )" Checks and returns the appropriate model of an acceptable element (be it explicitly declared, or part of an \f(CW\*(C`accept\*(C'\fR declaration). Returns undef if the element cannot be accepted. .SS "accept_regexp( name )" .IX Subsection "accept_regexp( name )" Returns the list of regular expressions used to check for acceptable parameters. Useful for diagnostics. .SS "element_exists( element_name )" .IX Subsection "element_exists( element_name )" Returns 1 if the element is known in the model. .SS "is_element_defined( element_name )" .IX Subsection "is_element_defined( element_name )" Returns 1 if the element is defined. .SS "grab(...)" .IX Subsection "grab(...)" See \*(L"grab(...)\*(R" in Config::Model::AnyThing. .SS "grab_value(...)" .IX Subsection "grab_value(...)" See \*(L"grab_value(...)\*(R" in Config::Model::AnyThing. .SS "\fIgrab_root()\fP" .IX Subsection "grab_root()" See \*(L"\fIgrab_root()\fR\*(R" in Config::Model::AnyThing. .SS "get( path => ..., mode => ... , check => ... , get_obj => 1|0, autoadd => 1|0)" .IX Subsection "get( path => ..., mode => ... , check => ... , get_obj => 1|0, autoadd => 1|0)" Get a value from a directory like path. If \f(CW\*(C`get_obj\*(C'\fR is 1, \f(CW\*(C`get\*(C'\fR will return leaf object instead of returning their value. .SS "set( path , value)" .IX Subsection "set( path , value)" Set a value from a directory like path. .SH "data modification" .IX Header "data modification" .SS "migrate" .IX Subsection "migrate" Force a read of the configuration and perform all changes regarding deprecated elements or values. Return 1 if data needs to be saved. .SS "apply_fixes" .IX Subsection "apply_fixes" Scan the tree from this node and apply fixes that are attached to warning specifications. See \f(CW\*(C`warn_if_match\*(C'\fR or \f(CW\*(C`warn_unless_match\*(C'\fR in "" in Config::Model::Value. .SS "load ( step => string [ ... ])" .IX Subsection "load ( step => string [ ... ])" Load configuration data from the string into the node and its siblings. .PP This string follows the syntax defined in Config::Model::Loader. See \*(L"load ( ... )\*(R" in Config::Model::Loader for details on parameters. .PP This method can also be called with a single parameter: .PP .Vb 1 \& $node\->load("some data:to be=loaded"); .Ve .ie n .SS "load_data ( data => hash_ref, [ check => $check, ... ])" .el .SS "load_data ( data => hash_ref, [ check => \f(CW$check\fP, ... ])" .IX Subsection "load_data ( data => hash_ref, [ check => $check, ... ])" Load configuration data with a hash ref. The hash ref key must match the available elements of the node (or accepted element). The hash ref structure must match the structure of the configuration model. .PP Use \f(CW\*(C`check => skip\*(C'\fR to make data loading more tolerant: bad data will be discarded. .PP \&\f(CW\*(C`load_data\*(C'\fR can be called with a single hash ref parameter. .SS "needs_save" .IX Subsection "needs_save" return 1 if one of the elements of the node's sub-tree has been modified. .SH "Serialization" .IX Header "Serialization" .SS "dump_tree ( ... )" .IX Subsection "dump_tree ( ... )" Dumps the configuration data of the node and its siblings into a string. See \*(L"dump_tree\*(R" in Config::Model::Dumper for parameter details. .PP This string follows the syntax defined in Config::Model::Loader. The string produced by \f(CW\*(C`dump_tree\*(C'\fR can be passed to \f(CW\*(C`load\*(C'\fR. .SS "dump_annotations_as_pod ( ... )" .IX Subsection "dump_annotations_as_pod ( ... )" Dumps the configuration annotations of the node and its siblings into a string. See \*(L"dump_annotations_as_pod\*(R" in Config::Model::Dumper for parameter details. .SS "describe ( [ element => ... ] )" .IX Subsection "describe ( [ element => ... ] )" Provides a description of the node elements or of one element. .SS "report ()" .IX Subsection "report ()" Provides a text report on the content of the configuration below this node. .SS "audit ()" .IX Subsection "audit ()" Provides a text audit on the content of the configuration below this node. This audit will show only value different from their default value. .SS "copy_from ( from => another_node_object, [ check => ... ] )" .IX Subsection "copy_from ( from => another_node_object, [ check => ... ] )" Copy configuration data from another node into this node and its siblings. The copy can be made in a \fItolerant\fR mode where invalid data is discarded with \f(CW\*(C`check => skip\*(C'\fR. This method can be called with a single argument: \f(CW\*(C`copy_from($another_node)\*(C'\fR .SH "Help management" .IX Header "Help management" .SS "get_help ( [ [ description | summary ] => element_name ] )" .IX Subsection "get_help ( [ [ description | summary ] => element_name ] )" If called without element, returns the description of the class (Stored in \f(CW\*(C`class_description\*(C'\fR attribute of a node declaration). .PP If called with an element name, returns the description of the element (Stored in \f(CW\*(C`description\*(C'\fR attribute of a node declaration). .PP If called with 2 argument, either return the \f(CW\*(C`summary\*(C'\fR or the \&\f(CW\*(C`description\*(C'\fR of the element. .PP Returns an empty string if no description was found. .SS "tree_searcher( type => ... )" .IX Subsection "tree_searcher( type => ... )" Returns an object able to search the configuration tree. Parameters are : .IP "type" 4 .IX Item "type" Where to perform the search. It can be \f(CW\*(C`element\*(C'\fR, \f(CW\*(C`value\*(C'\fR, \&\f(CW\*(C`key\*(C'\fR, \f(CW\*(C`summary\*(C'\fR, \f(CW\*(C`description\*(C'\fR, \f(CW\*(C`help\*(C'\fR or \f(CW\*(C`all\*(C'\fR. .PP Typically, you will have to call \f(CW\*(C`search\*(C'\fR on this object. .PP Returns a Config::Model::TreeSearcher object. .SS "Lazy load of node data" .IX Subsection "Lazy load of node data" As configuration model are getting bigger, the load time of a tree gets longer. The Config::Model::BackendMgr class provides a way to load the configuration information only when needed. .SH "AUTHOR" .IX Header "AUTHOR" Dominique Dumont, (ddumont at cpan dot org) .SH "SEE ALSO" .IX Header "SEE ALSO" Config::Model, Config::Model::Instance, Config::Model::HashId, Config::Model::ListId, Config::Model::CheckList, Config::Model::WarpedNode, Config::Model::Value .SH "AUTHOR" .IX Header "AUTHOR" Dominique Dumont .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is Copyright (c) 2014 by Dominique Dumont. .PP This is free software, licensed under: .PP .Vb 1 \& The GNU Lesser General Public License, Version 2.1, February 1999 .Ve