NAME
WWW::USF::Directory - Access to USF's online directory
VERSION
Version 0.002_001
SYNOPSIS
# Make a directory object
my
$directory
= WWW::USF::Directory->new();
# Make all searches return only staff
$directory
->include_faculty(0);
$directory
->include_staff(1);
$directory
->include_students(0);
# Search for people with the name "Jimmy"
foreach
my
$staff
(
$directory
->search(
name
=>
'Jimmy'
)) {
# Full Name: email@address
$staff
->full_name,
': '
,
$staff
->email_address,
"\n"
;
}
# This search will also include students
foreach
my
$entry
(
$directory
->search(
name
=>
'Barnes'
,
include_students
=> 1)) {
$entry
->full_name,
"\n"
;
# This search will be in the Tampa campus
foreach
my
$entry
(
$directory
->search(
name
=>
'Williams'
,
campus
=>
'Tampa'
)) {
$entry
->full_name,
"\n"
;
}
# Print out the list of colleges
join
"\n"
,
$directory
->college_list,
q{}
;
DESCRIPTION
This provides a way in which you can interact with the online directory at the University of South Florida.
CONSTRUCTOR
This is fully object-oriented, and as such before any method can be used, the constructor needs to be called to create an object to work with.
new
This will construct a new object.
- new(%attributes)
-
%attributes
is a HASH where the keys are attributes (specified in the "ATTRIBUTES" section). - new($attributes)
-
$attributes
is a HASHREF where the keys are attributes (specified in the "ATTRIBUTES" section).
ATTRIBUTES
# Set an attribute
$object
->attribute_name(
$new_value
);
# Get an attribute
my
$value
=
$object
->attribute_name;
directory_url
This is the URL that commands are sent to in order to interact with the online directory. This can be a URI object or a string. This will always return a URI object.
include_faculty
This a Boolean of whether or not to include faculty in the search results. The default is true.
include_staff
This a Boolean of whether or not to include staff in the search results. The default is true.
include_students
This a Boolean of whether or not to include students in the search results. The default is false.
user_agent
This is the user agent that will be used to make the HTTP requests. This internally maps to the user agent in the Net::SAJAX object and the default is the default for Net::SAJAX.
METHODS
campus_list
This will return a list of strings that are the names of the campuses.
college_list
This will return a list of strings that are the names of the colleges.
department_list
This will return a list of strings that are the names of the departments.
search
This will search the online directory and return an array of WWW::USF::Directory::Entry objects as the results of the search. This method takes a HASH as the argument with the following keys:
- campus
-
This is the string name of the campus to search in. A list of possible entries can be retrieved using "campus_list". The default to to search all campuses.
- college
-
This is the string name of the college to search in. A list of possible entries can be retrieved using "college_list". The default is to search all colleges.
- department
-
This is the string name of the department to search in. A list of possible entries can be retrieved using "department_list". The default is to search all departments.
- name
-
Required. The name of the person to search for.
- include_faculty
-
This a Boolean of whether or not to include faculty in the search results. The default is the value of the "include_faculty" attribute.
- include_staff
-
This a Boolean of whether or not to include staff in the search results. The default is the value of the "include_staff" attribute.
- include_students
-
This a Boolean of whether or not to include students in the search results. The default is the value of the "include_students" attribute.
DIAGNOSTICS
This module will throw WWW::USF::Directory::Exception objects on errors as well as any upstream exception objects like Net::SAJAX::Exception. This means that all method return values are guaranteed to be correct. Please read the relevant exception classes to find out what objects will be thrown.
WWW::USF::Directory::Exception for general exceptions not in other categories and the base class.
WWW::USF::Directory::Exception::MethodArguments for exceptions related to the values of arguments given to methods.
WWW::USF::Directory::Exception::TooManyResults for searches returning too many results.
WWW::USF::Directory::Exception::UnknownRespose for responses from the server that were not known when the module was written.
DEPENDENCIES
HTML::HTML5::Parser 0.03
List::MoreUtils 0.07
Moose 0.89
Net::SAJAX 0.102
Readonly 1.03
namespace::clean 0.04
AUTHOR
Douglas Christopher Wilson, <doug at somethingdoug.com>
BUGS AND LIMITATIONS
There are no indended limitations, and so if you find a feature in the USF directory that is not implemented here, please let me know.
Please report any bugs or feature requests to bug-www-usf-directory at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-USF-Directory. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc WWW::USF::Directory
You can also look for information at:
RT: CPAN's request tracker
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
LICENSE AND COPYRIGHT
Copyright 2010 Douglas Christopher Wilson, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of either:
the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or
the Artistic License version 2.0.