Perl Modules and Objects
Standard distribution
- CGI (CGI query object manipulation and methods to create HTML)
- IPC::Open3 (allows forking off of process; used for forking XPat
so that the cgi can talk to XPat during its running)
Additional Perl modules
- DBI (database interface)
- Apache::Session (used to store data on the server between runs of
the CGI)
DLPS related
- Object-Oriented
- XPat, XPatSearchSet, XPatResult, XPatResultSet
- XPat
- encapsulates the cgis communication with a running XPat process
- searches can be individually created and results retrieved OR
- the queries can be packaged into XPatSearchSets and sent
as a whole to be run as queries against XPat one after another
- the results (an XPat set for each query is contained in an XPatResult
object) are then packaged into Middleware XPatResultSet which can
later be iterated through
- Bookbag / Portfolio / Personal Collection
- user can add individual items (bib records, images, books, etc.)
into this set of items.
- In TextClass, can run searches against this set.
- DlpsSession
- Since Apache::Session uses Perl tied hashes to access data, and
we prefered a more consistent OO approach and syntax, we wrapped the
Apache::Session object with our own object. Access to data is therefore
the usual Perl Object -> syntax
- QueryFactory, TerminologyMapper
- Maps are used to map certain terms to XPat regions (so, for example,
the word title may map to region TITLE within ....
- The QueryFactory takes the CGI object and the TermMapper and creates
a well-formed XPat query.
- These are older object modules that could use some rewriting.
- ProcIns
- used in conjunction with HTML templates (html files with parts
that will be filled in with the running of the cgi)
- Processing Instructions in the form of <?INSTRUCTION [param=value
...]> can be inserted in HTML. When the cgi program parses the
HTML template, the PI will be replaced with some html packaged data
or image or...
- Classes (for now TextClass only, BibClass & ImageClass are
not OO yet)
- Each of the document classes has its own Perl class module that
encapsulates much of its information and behavior.
- PageViewer
- This object encapsulates the page data in all the PB tags of a
page-image based SGML document.
- WordWheel
- This object encapsulates a part of the data retrieved during a
wordwheel search
- CollsInfo.pm, GroupsInfo.pm
- During the beginning of the running of a cgi, info about collections
and groups of collections are read into these objects so that it can
be easily accessed during the rest of the cgis run
- non Object-Oriented
- DbUtils: various subroutines to handle common DLXS related DBI
work
- DlpsUtils: miscellaneous utility subroutines; e.g., sorting
and uniqu-ifying a list, max, min, get list of authorized collections
from the environment, etc.
- DevUtils: routines used only in the development environment
- TextClassUtils: general routines in TextClass, filtering, building
some HTML, etc. (many of the subroutines here will be moved to TextClass
and turned into methods)
- DLPSLocalUtils
- ICLocalUtils
- Versioned LibVersion.pm