.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29) .\" .\" 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 "2016-09-18" "perl v5.22.2" "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 2.006 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& # Itself constructor returns an object to read or write the data \& # structure containing the model to be edited \& my $meta_model = Config::Model::Itself \-> new( ) ; \& \& # now load the model to be edited \& $meta_model \-> read_all( ) ; \& \& # For Curses UI prepare a call\-back to write model \& my $wr_back = sub { $meta_model\->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\->config_root ) ; \& \& # 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 ( [ cm_lib_dir => ... ] )" .IX Subsection "new ( [ cm_lib_dir => ... ] )" Creates a new read/write handler. If no model_object is passed, the required objects are created. \f(CW\*(C`cm_lib_dir\*(C'\fR specifies where are the model files (defaults to \&\f(CW\*(C`./lib/Config/Model\*(C'\fR. .PP \&\f(CW\*(C`cm_lib_dir\*(C'\fR is either a \f(CW\*(C`Path::Tiny\*(C'\fR object or a string. .PP By default, this constructor will create all necessary \&\f(CW\*(C`Config::Model*\*(C'\fR objects. If needed, you can pass already created object with options \f(CW\*(C`config_model\*(C'\fR (Config::Model object), \&\f(CW\*(C`meta_instance\*(C'\fR (Config::Model::Instance object) or \f(CW\*(C`meta_root\*(C'\fR (Config::Model::Node object). .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 structure of the configuration model: .IP "\(bu" 4 \&\f(CW\*(C`include\*(C'\fR relations 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 "BUGS" .IX Header "BUGS" Test menu entries are created from the content of \f(CW\*(C`application\*(C'\fR model parameter. Unfortunately, there's no way to build the menu dynamically. So user cme must be restarted to change the menu if the application list is changed. .SH "SEE ALSO" .IX Header "SEE ALSO" Config::Model, Config::Model::Node, Path::Tiny .SH "AUTHOR" .IX Header "AUTHOR" Dominique Dumont .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is Copyright (c) 2007\-2016 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 .SH "SUPPORT" .IX Header "SUPPORT" .SS "Websites" .IX Subsection "Websites" The following websites have more information about this module, and may be of help to you. As always, in addition to those websites please use your favorite search engine to discover more resources. .IP "\(bu" 4 Search \s-1CPAN\s0 .Sp The default \s-1CPAN\s0 search engine, useful to view \s-1POD\s0 in \s-1HTML\s0 format. .Sp .IP "\(bu" 4 AnnoCPAN .Sp The AnnoCPAN is a website that allows community annotations of Perl module documentation. .Sp .IP "\(bu" 4 \&\s-1CPAN\s0 Ratings .Sp The \s-1CPAN\s0 Ratings is a website that allows community ratings and reviews of Perl modules. .Sp .IP "\(bu" 4 \&\s-1CPANTS\s0 .Sp The \s-1CPANTS\s0 is a website that analyzes the Kwalitee ( code metrics ) of a distribution. .Sp .IP "\(bu" 4 \&\s-1CPAN\s0 Testers .Sp The \s-1CPAN\s0 Testers is a network of smokers who run automated tests on uploaded \s-1CPAN\s0 distributions. .Sp .IP "\(bu" 4 \&\s-1CPAN\s0 Testers Matrix .Sp The \s-1CPAN\s0 Testers Matrix is a website that provides a visual overview of the test results for a distribution on various Perls/platforms. .Sp .IP "\(bu" 4 \&\s-1CPAN\s0 Testers Dependencies .Sp The \s-1CPAN\s0 Testers Dependencies is a website that shows a chart of the test results of all dependencies for a distribution. .Sp .SS "Bugs / Feature Requests" .IX Subsection "Bugs / Feature Requests" Please report any bugs or feature requests by email to \f(CW\*(C`ddumont at cpan.org\*(C'\fR, or through the web interface at . You will be automatically notified of any progress on the request by the system. .SS "Source Code" .IX Subsection "Source Code" The code is open to the world, and available for you to hack on. Please feel free to browse it and play with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull from your repository :) .PP .PP .Vb 1 \& git clone git://github.com/dod38fr/config\-model\-itself.git .Ve