App-Office-Contacts
view release on metacpan or search on metacpan
lib/App/Office/Contacts.pm view on Meta::CPAN
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.
I have switched to plurals for the names of database tables though.
=head2 What is the database schema?
L<The database schema|http://savage.net.au/Module-reviews/images/Contacts/contacts.schema.png>.
The file was created with dbigraph.pl.
dbigraph.pl ships with C<GraphViz::DBI>. I patched it to use C<GraphViz::DBI::General>.
The command is:
dbigraph.pl --dsn 'dbi:Pg:dbname=contacts' --user contact --pass contact > docs/contacts.schema.png
The username and password are as shipped in C<share/.htapp.office.contacts.conf>.
As always after editing the config file, run:
shell> perl scripts/copy.config.pl
shell> perl scripts/find.config.pl (as a cross-check)
Alternately, edit the installed copy rather than the copy shipped with the distro.
=head2 Why do the email_addresses and phone_numbers tables have upper-case fields?
Because the search feature always uses upper-case. And, e.g., phones can have eXtension information built-in,
as in '123456x78'. So the 'x' in a search request needs to be upper-cased. And yes, I have worked on a
personnel + phone number system (at Monash University) which stores (Malaysian) phone numbers like that.
The case for email addresses is rather more obvious.
=head2 Does the database server have pre-requisites?
The code is DBI-based, of course.
Also, the code assumes the database server supports $dbh -> last_insert_id(undef, undef, $table_name, undef).
=head2 What engine type do you use when I use MySQL?
Engine type defaults to innodb when you use MySQL in the dsn.
See C<share/.htapp.office.contacts.conf> for the dsn and the source code of L<App::Office::Contacts::Util::Create>
for the create statements.
( run in 0.509 second using v1.01-cache-2.11-cpan-39bf76dae61 )