App-Office-Contacts

 view release on metacpan or  search on metacpan

lib/App/Office/Contacts.pm  view on Meta::CPAN

	# Set up the session. This tells us we got this far.

	$self -> log(info => 'Session id: ' . $self -> param('db') -> session -> id);

}	# End of global_prerun.

# -----------------------------------------------

sub teardown
{
	my($self) = @_;

	$self -> log(debug => 'Contacts.teardown()');
	$self -> param('db') -> session -> flush;
	$self -> logger -> log_object -> disconnect; # The logger's log_object has its own dbh.
	$self -> logger -> simple -> disconnect;     # The logger's 'simple' object has a dbh.

} # End of teardown.

# -----------------------------------------------

1;

=head1 NAME

App::Office::Contacts - A web-based contacts manager

=head1 Synopsis

A classic CGI script, I<contacts.cgi>:

	#!/usr/bin/env perl

	use strict;
	use warnings;

	use CGI;
	use CGI::Snapp::Dispatch;

	# ---------------------

	my($cgi) = CGI -> new;

	CGI::Snapp::Dispatch -> new -> dispatch
	(
		args_to_new => {QUERY => $cgi},
		prefix      => 'App::Office::Contacts::Controller',
		table       =>
		[
		''              => {app => 'Initialize', rm => 'display'},
		':app'          => {rm => 'display'},
		':app/:rm/:id?' => {},
		],
	);

A L<Plack> script, I<contacts.psgi>:

	#!/usr/bin/env perl
	#
	# Run with:
	# starman -l 127.0.0.1:5003 --workers 1 httpd/cgi-bin/office/contacts.psgi &
	# or, for more debug output:
	# plackup -l 127.0.0.1:5003 httpd/cgi-bin/office/contacts.psgi &

	use strict;
	use warnings;

	use CGI::Snapp::Dispatch;

	use Plack::Builder;

	# ---------------------

	my($app) = CGI::Snapp::Dispatch -> new -> as_psgi
	(
		prefix => 'App::Office::Contacts::Controller',
		table  =>
		[
		''              => {app => 'Initialize', rm => 'display'},
		':app'          => {rm => 'display'},
		':app/:rm/:id?' => {},
		],
	);

	builder
	{
		enable "ContentLength";
		enable 'Static',
		path => qr!^/(assets|favicon)!,
		root => '/dev/shm/html';
		$app;
	};

The scripts discussed here, I<contacts.cgi> and I<contacts.psgi>, are shipped with this module,
in the httpd/ directory.

For more on Plack, see L<My intro to Plack|http://savage.net.au/Perl/html/plack.for.beginners.html>.

=head1 Description

C<App::Office::Contacts> implements a utf8-aware, web-based, private and group contacts manager.

Here 'private' means you can specify which contacts are not to appear in the search results of other
people using the same database. You do this by setting their visibility to 'Just me'.

C<App::Office::Contacts> uses the light-weight module L<Moo>.

Major features:

=over 4

=item o utf8-aware

=item o Any number of people

=item o Any number of organizations

=item o People can have any number of occupations

=item o Organizations can have any number of staff



( run in 1.603 second using v1.01-cache-2.11-cpan-e93a5daba3e )