App-Office-Contacts
view release on metacpan or search on metacpan
lib/App/Office/Contacts.pm view on Meta::CPAN
Alternately, edit the installed copy rather than the copy shipped with the distro.
=back
So, if you leave out the '-Ilib', Perl will use the version of the code which has been
formally installed.
=head3 Start testing
Point your broswer at C<http://127.0.0.1/cgi-bin/contacts.cgi>.
Your first search can then be just 'a', without the quotes.
=head1 Object attributes
=over 4
=item o See the parent module L<CGI::Snapp>
=back
=head1 Methods
=head2 build_about_html($user_id)
Creates a HTML table for the About tab.
Note: The code does not currently use $user_id. It is present as provision if the code is patched to
identify logged-on users. See the L</FAQ> for a discussion of this issue.
=head2 build_web_page()
Creates the basic web page in response to the very first request from the user.
=head2 global_prerun()
Contains code shared by this module and L<App::Office::Contacts::Donations>.
=head2 teardown()
Shuts down database connexions, etc, as the program is exiting.
=head1 FAQ
=head2 How do I delete an organization or person?
Search for them, and then set their visibility to No-one. Hence they stay in the database but are no
longer visible.
=head2 Is utf8 supported in V 2.00?
Yes. L<Text::CSV::Encoded> is used in C<App::Office::Contacts::Util::Import> to read data/fake.people.txt.
See L</Creating and populating the database> for a discussion of scripts/populate.fake.people.pl.
Do a search for Brocard, the author of the original L<GraphViz>, and you will find LE<233>on Brocard.
Also, see lines 48 .. 52 in the config file for options to control the utf8 setting in the connect() attributes
as used by L<DBI>. These are the defaults:
mysql_enable_utf8 = 1
# pg_enable_utf8 == 0 for DBD::Pg V 3.0.0 in my code.
pg_enable_utf8 = 0
sqlite_unicode = 1
These values are used in App::Office::Contacts::Util::Logger lines 44 .. 57.
=head2 Why not allow multiple Facebook and Twitter tags per org or person?
This is under consideration.
=head2 How can I update the spouses table?
You cannot. I have not yet decided how to provide an on-screen mechanism to update this table.
=head2 How is the code structured?
MVC (Model-View-Controller).
The sample scripts I<contacts.cgi> and I<contacts> use
prefix => 'App::Office::Contacts::Controller'
so the files in C<lib/App/Office/Contacts/Controller> and C<lib/App/Office/Contacts/Controller/Exporter> are the
modules which are run to respond to http requests.
Files in C<lib/App/Office/Contacts/View> implement views, and those in C<lib/App/Office/Contacts/Database>
implement the model.
Files in C<lib/App/Office/Contacts/Util> are a mixture:
=over 4
=item Config.pm
This is used by all code.
=item Create.pm
This is just used to create tables, populate them, and drop them.
Hence it will not be used by C<CGI> scripts, unless you write such a script yourself.
=item Validator.pm
This is used to validate CGI form data.
=back
=head2 Why did you use Sub::Exporter?
The way I wrote the code, various pairs of classes, e.g.
L<App::Office::Contacts::Controller::Note> and
L<App::Office::Contacts::Donations::Controller::Note>, could share a lot of code,
but they had incompatible parents. Sub::Exporter solved this problem.
And since Controller.pm is derived from CGI::Snapp and not Moo, we cannot use Moo::Role.
=head2 In the source, it seems you use singular words for the names of arrays and array refs.
Yes I do. I think in terms of the nature of each element, not the storage mechanism.
( run in 2.610 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )