NAME
CGI::Office::Contacts::Import::vCards
- Import vCards for use by CGI::Office::Contacts
Synopsis
The scripts discussed here, vcards.cgi and vcards, are shipped with this module.
A classic CGI script, vcards.cgi:
use strict;
use warnings;
use CGI;
use CGI::Application::Dispatch;
# ---------------------
my($cgi) = CGI -> new;
CGI::Application::Dispatch -> dispatch
(
args_to_new => {QUERY => $cgi},
prefix => 'CGI::Office::Contacts::Import::vCards::Controller',
table =>
[
'' => {app => 'Initialize', rm => 'display'},
':app' => {rm => 'display'},
':app/:rm' => {},
],
);
A fancy FCGI script, vcards:
use strict;
use warnings;
use CGI::Application::Dispatch;
use CGI::Fast;
use FCGI::ProcManager;
# ---------------------
my($proc_manager) = FCGI::ProcManager -> new({processes => 2});
$proc_manager -> pm_manage;
my($cgi);
while ($cgi = CGI::Fast -> new)
{
$proc_manager -> pm_pre_dispatch();
CGI::Application::Dispatch -> dispatch
(
args_to_new => {QUERY => $cgi},
prefix => 'CGI::Office::Contacts::Import::vCards::Controller',
table =>
[
'' => {app => 'Initialize', rm => 'display'},
':app' => {rm => 'display'},
':app/:rm' => {},
],
);
$proc_manager -> pm_post_dispatch;
}
Description
CGI::Office::Contacts::Import::vCards
implements importing vCards for use by CGI::Office::Contacts
.
CGI::Office::Contacts::Import::vCards
uses Moose
.
Distributions
This module is available as a Unix-style distro (*.tgz).
See http://savage.net.au/Perl-modules/html/installing-a-module.html for help on unpacking and installing distros.
Installation Pre-requisites
The primary pre-requisite is CGI::Office::Contacts
. You should study the documentation for that module before proceeding.
Installing the module
Note: Neither Build.PL nor Makefile.PL refer to FCGI::ProcManager
. If you are only going to use the classic CGI script 'contacts.cgi', you don't need FCGI::ProcManager
.
Install CGI::Office::Contacts::Import::vCards
as you would for any Perl
module:
Run cpan: shell>sudo cpan CGI::Office::Contacts::Import::vCards
or unpack the distro, and then either:
perl Build.PL
./Build
./Build test
sudo ./Build install
or:
perl Makefile.PL
make (or dmake)
make test
make install
Either way, you'll need to install all the other files which are shipped in the distro.
Install the HTML::Template
files.
Copy the distro's htdocs/assets/ directory to your web server's doc root.
Specifically, my doc root is /var/www/, so I end up with /var/www/assets/.
Install the trivial CGI script
Copy the distro's httpd/cgi-bin/office/ directory to your web server's cgi-bin/ directory, and make vacrds.cgi executable.
So, I end up with /usr/lib/cgi-bin/office/import/vcards.cgi.
Now I can run http://127.0.0.1/cgi-bin/office/import/vcards.cgi.
Install the fancy FCGI script (optional)
Copy the distro's htdocs/office/ directory to your web server's doc root, and make vcards executable.
So, I end up with /var/www/office/import/vcards.
Now I can run http://127.0.0.1/office/import/vcards.
For FCGID
, see http://fastcgi.coremail.cn/.
FCGID
is a replacement for the older FastCGI
. For FastCGI
, see http://www.fastcgi.com/drupal/.
Start testing
Point your broswer at http://127.0.0.1/cgi-bin/import/vcards.cgi (trivial script), or http://127.0.0.1/office/import/vcards (fancy script).
FAQ
- Does the import code guess any values?
-
Yes, both gender and title are derived from the data, rather than being just pieces of data. This means neither of these 2 values are guaranteed to be correct.
Support
Log bug reports with RT.
The mailing list details are:
Mail list: cgi-office@X
Help address: cgi-office-help@X
Subscription address: cgi-office-subscribe@X
Unsubscription address: cgi-office-unsubscribe@X
where X is as per my email address at the bottom of my home page (below).
On-line help for ezmlm: http://www.ezmlm.org/manual/
Author
CGI::Office::Contacts::Import::vCards
was written by Ron Savage <ron@savage.net.au> in 2009.
Home page: http://savage.net.au/index.html
Copyright
Australian copyright (c) 2009, Ron Savage. All rights reserved.
All Programs of mine are 'OSI Certified Open Source Software';
you can redistribute them and/or modify them under the terms of
The Artistic License, a copy of which is available at:
http://www.opensource.org/licenses/index.html