.\" 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::Itself 3pm" .TH Config::Model::Itself 3pm "2014-10-23" "perl v5.20.1" "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::Itself \- Model editor for Config::Model .SH "VERSION" .IX Header "VERSION" version 1.241 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& my $meta_model = Config::Model \-> new ( ) ; \& \& # load Config::Model model \& my $meta_inst = $model\->instance ( \& root_class_name => \*(AqItself::Model\*(Aq , \& instance_name => \*(Aqmeta_model\*(Aq , \& ); \& \& my $meta_root = $meta_inst \-> config_root ; \& \& # Itself constructor returns an object to read or write the data \& # structure containing the model to be edited \& my $rw_obj = Config::Model::Itself \-> new( \& model_object => $meta_root, \& model_dir => \*(Aq/path/to/model_files\*(Aq , \& ) ; \& \& # now load the model to be edited \& $rw_obj \-> read_all( ) ; \& \& # For Curses UI prepare a call\-back to write model \& my $wr_back = sub { $rw_obj\->write_all(); \& \& # create Curses user interface \& my $dialog = Config::Model::CursesUI\-> new \& ( \& store => $wr_back, \& ) ; \& \& # start Curses dialog to edit the mode \& $dialog\->start( $meta_model ) ; \& \& # that\*(Aqs it. When user quits curses interface, Curses will call \& # $wr_back sub ref to write the modified model. .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Config::Itself module and its model files provide a model of Config:Model (hence the Itself name). .PP Let's step back a little to explain. Any configuration data is, in essence, structured data. This data could be stored in an \s-1XML\s0 file. A configuration model is a way to describe the structure and relation of all items of a configuration data set. .PP This configuration model is also expressed as structured data. This structure data is structured and follow a set of rules which are described for humans in Config::Model. .PP The structure and rules documented in Config::Model are also expressed in a model in the files provided with \&\f(CW\*(C`Config::Model::Itself\*(C'\fR. .PP Hence the possibity to verify, modify configuration data provided by Config::Model can also be applied on configuration models. Using the same user interface. .PP From a Perl point of view, Config::Model::Itself provides a class dedicated to read and write a set of model files. .SH "Constructor" .IX Header "Constructor" .SS "new ( model_object => ... , model_dir => ... )" .IX Subsection "new ( model_object => ... , model_dir => ... )" Creates a new read/write handler. This handler is dedicated to the \&\f(CW\*(C`model_object\*(C'\fR passed with the constructor. This parameter must be a Config::Model::Node class. .SS "Methods" .IX Subsection "Methods" .SH "read_all ( root_model => ... , [ force_load => 1 ] )" .IX Header "read_all ( root_model => ... , [ force_load => 1 ] )" Load all the model files contained in \f(CW\*(C`model_dir\*(C'\fR and all its subdirectories. \f(CW\*(C`root_model\*(C'\fR is used to filter the classes read. .PP Use \f(CW\*(C`force_load\*(C'\fR if you are trying to load a model containing errors. .PP \&\f(CW\*(C`read_all\*(C'\fR returns a hash ref containing ( class_name => file_name , ...) .SS "write_all" .IX Subsection "write_all" Will write back configuration model in the specified directory. The structure of the read directory is respected. .SS "write_model_snippet( snippet_dir => foo, model_file => bar.pl )" .IX Subsection "write_model_snippet( snippet_dir => foo, model_file => bar.pl )" Write snippet models in separate \f(CW\*(C`.d\*(C'\fR directory. E.g. a snippet for class \&\f(CW\*(C`Foo::Bar\*(C'\fR will be written in \f(CW\*(C`Foo/Bar.d/bar.pl\*(C'\fR file. This file is to be used by augment_config_class '...', class_data )"> .SS "read_model_snippet( snippet_dir => foo, model_file => bar.pl )" .IX Subsection "read_model_snippet( snippet_dir => foo, model_file => bar.pl )" To read model snippets, this methid will search recursively \f(CW$snippet_dir\fR and load all \f(CW\*(C`bar.pl\*(C'\fR files found in there. .SS "list_class_element" .IX Subsection "list_class_element" Returns a string listing all the class and elements. Useful for debugging your configuration model. .SS "get_dot_diagram" .IX Subsection "get_dot_diagram" Returns a graphviz dot file that represents the strcuture of the configuration model: .IP "\(bu" 4 \&\f(CW\*(C`include\*(C'\fR are represented by solid lines .IP "\(bu" 4 Class usage (i.e. \f(CW\*(C`config_class_name\*(C'\fR parameter) is represented by dashed lines. The name of the element is attached to the dashed line. .SH "SEE ALSO" .IX Header "SEE ALSO" Config::Model, Config::Model::Node, .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