Like most Perl modules, the RefDBClient::Client module is object-oriented. This section introduces the two classes that you need to know in order to work with the module. To see a working example, please check the test.pl
script shipped with the module.
The main class that is used to access all RefDB client functions is called RefDBClient::Client. To get started, create a new instance and set the communication parameters:
use RefDBClient::Client; my $client = new RefDBClient::Client; $client->set_conninfo("127.0.0.1", "9734", "markus", "pass", "refdbtest", "/home/markus/literature", "/usr/local/share/refdb/css/refdb.css", "360");
Then you can go ahead and send commands to the server like this:
$summary = $client->refdb_listdb(""); $data = $client->get_data();
As you can easily guess the functions implementing the client commands are analogous to the commands found in the refdba and refdbc clients. See the reference pages about these apps for further information about the commands.
There are three helper classes:
RefDBClient::Risdata provides a simple interface to RIS data
ReFDBClient::Simplelist is used internally
RefDBClient::Enigma handles the password encryption
$client->set_conninfo( | $server_ip, | |
$port_address, | ||
$username, | ||
$password, | ||
$database, | ||
$pdf_root, | ||
$css_url, | ||
$timeout) ; |
sets the initial connection parameters of a Client object
IP address or hostname of the server that runs refdbd
Port address at which refdbd listens
Username for database password authentication
Password for database password authentication
Name of the reference database
Path of the root directory of all electronic offprints
URL of a Cascading Stylesheets file for (X)HTML output
Timeout in seconds after which a stale connection is taken down
$client->refdb_addstyle( | $styledata) ; |
adds a citation/bibliography style to the database
XML data representing the bibliography style
$client->refdb_adduser( | $host, | |
$database, | ||
$newuserpassword, | ||
$username) ; |
adds new users to the database
host specification from which the user is allowed to connect
name of the reference database
password (required only for new users)
name of the user, as used to authenticate at the database engine
$client->refdb_deleteuser( | $host, | |
$database, | ||
$username) ; |
deletes users from the database
host specification from which the user is allowed to connect
name of the reference database
name of the user, as used to authenticate at the database engine
$client->refdb_addword( | $words) ; |
adds reserved words to the main database
space-separated list of words
$summary = $client->refdb_deleteword( | $words) ; |
removes reserved words from the main database
space-separated list of words
$client->refdb_confserv( | $command) ; |
sends a configuration command to the server
the command proper, optionally followed by an argument
$client->refdb_createdb( | $dbname, | |
$encoding) ; |
creates a new database
name of the reference database
character encoding
$client->refdb_deletedb( | $databasename) ; |
deletes a reference database
name of the database
$client->refdb_deletestyle( | $stylename_regexp) ; |
deletes citation/bibliography styles
regular expression describing the names of the styles to be deleted
$client->refdb_getstyle( | $stylename) ; |
retrieves a citation/bibliography style as a citestylex doc
name of the style
$client->refdb_listdb( | $dbname_regexp) ; |
lists matching databases
regular expression describing the database names
$client->refdb_listuser( | $dbname, | |
$username_regexp) ; |
lists matching user names
regular expression describing the user names
$client->refdb_listword( | $word_regexp) ; |
lists matching journal name words
regular expression describing the word names
$client->refdb_liststyle( | $stylename_regexp) ; |
lists matching citation/bibliography styles
regular expression describing the style names
$client->refdb_scankw( | $dbname) ; |
runs a thorough keyword scan in the given database
name of the reference database
$client->refdb_addref( | $owner, | |
$refdata, | ||
$type, | ||
$encoding) ; |
adds references to the database
name of the dataset owner, if different from current user
string containing the reference data
data type, must be one of 'ris' or 'risx'
character encoding of the input data (only for RIS data)
$client->refdb_checkref( | $risdata, | |
$type, | ||
$encoding, | ||
$outtype) ; |
Checks new references against the references in the database without adding them permanently
string containing the reference data
data type, must be one of 'ris' or 'risx'
character encoding of the input data (only for RIS data)
output data type, must be one of 'scrn' or 'xhtml'
$client->refdb_updateref( | $owner, | |
$is_personal, | ||
$risdata, | ||
$type, | ||
$encoding) ; |
updates references in the database
name of the dataset owner, if different from current user
set to 't' if only the personal information shall be updated
string containing the reference data
data type, must be one of 'ris' or 'risx'
character encoding of the input data (only for RIS data)
$client->refdb_deleteref( | $idlist) ; |
deletes references from the database
string specifying the IDs of the references to be deleted
$client->refdb_addnote( | $owner, | |
$xnotedata) ; |
adds notes to the database
owner of the note, if different from the current user
XML data specifying the note
$client->refdb_updatenote( | $owner, | |
$is_personal, | ||
$xnotedata) ; |
updates references in the database
owner of the note, if different from the current user
set to 't' if only the personal information shall be updated
XML data specifying the note
$client->refdb_deletenote( | $idlist) ; |
deletes notes from the database
string specifying the ID values of the notes to be deleted
$client->refdb_addlink( | $linkspec) ; |
links notes to database objects
string specifying the link(s) to be created
$client->refdb_deletelink( | $linkspec) ; |
unlinks notes from database objects
string specifying the link(s) to be deleted
$client->refdb_getas( | $limit_string, | |
$name_regexp) ; |
retrieves matching series authors
Limits the matching datasets. Must be in the form 'limit[:offset]', where limit is the number of returned datasets, and offset the number of datasets to skip.
regular expression describing the names to be retrieved
$client->refdb_getau( | $limit_string, | |
$name_regexp) ; |
retrieves matching authors
Limits the matching datasets. Must be in the form 'limit[:offset]', where limit is the number of returned datasets, and offset the number of datasets to skip.
regular expression describing the names to be retrieved
$client->refdb_geted( | $limit_string, | |
$name_regexp) ; |
retrieves matching editors
Limits the matching datasets. Must be in the form 'limit[:offset]', where limit is the number of returned datasets, and offset the number of datasets to skip.
regular expression describing the names to be retrieved
$client->refdb_getkw( | $limit_string, | |
$keyword_regexp) ; |
retrieves matching keywords
Limits the matching datasets. Must be in the form 'limit[:offset]', where limit is the number of returned datasets, and offset the number of datasets to skip.
regular expression describing the keywords to be retrieved
$client->refdb_getjf( | $is_all, | |
$limit_string, | ||
$journal_regexp) ; |
retrieves matching periodicals (full names)
set to 't' if all synonymous journal names shall be returned
Limits the matching datasets. Must be in the form 'limit[:offset]', where limit is the number of returned datasets, and offset the number of datasets to skip.
regular expression describing the names to be retrieved
$client->refdb_getjo( | $is_all, | |
$limit_string, | ||
$journal_regexp) ; |
retrieves matching periodical names (abbrev)
set to 't' if all synonymous journal names shall be returned
Limits the matching datasets. Must be in the form 'limit[:offset]', where limit is the number of returned datasets, and offset the number of datasets to skip.
regular expression describing the names to be retrieved
$client->refdb_getj1( | $is_all, | |
$limit_string, | ||
$journal_regexp) ; |
retrieves matching periodical names (custom abbrev 1)
set to 't' if all synonymous journal names shall be returned
Limits the matching datasets. Must be in the form 'limit[:offset]', where limit is the number of returned datasets, and offset the number of datasets to skip.
regular expression describing the names to be retrieved
$client->refdb_getj2( | $is_all, | |
$limit_string, | ||
$journal_regexp) ; |
retrieves matching periodical names (custom abbrev 2)
set to 't' if all synonymous journal names shall be returned
Limits the matching datasets. Must be in the form 'limit[:offset]', where limit is the number of returned datasets, and offset the number of datasets to skip.
regular expression describing the names to be retrieved
$client->refdb_getref( | $type, | |
$format_string, | ||
$sort_string, | ||
$listname, | ||
$encoding, | ||
$limit_string, | ||
$query_string) ; |
retrieves references
select output format
specify additional fields to be retrieved
specify sorting key
specify a list name if the search is to be confined to a particular personal reference list
the character encoding for the output data
Limits the matching datasets. Must be in the form 'limit[:offset]', where limit is the number of returned datasets, and offset the number of datasets to skip.
the query that describes the datasets to be retrieved
$client->refdb_countref( | $listname, | |
$limit_string, | ||
$query_string) ; |
Counts matching references
specify a list name if the search is to be confined to a particular personal reference list
Limits the matching datasets. Must be in the form 'limit[:offset]', where limit is the number of returned datasets, and offset the number of datasets to skip.
the query that describes the datasets to be counted
$client->refdb_pickref( | $idlist$listname) ; |
adds references to the users personal reference list
specifies the ID values of the references to be picked
the name of the personal list that the references should be added to. If this string is empty, the default personal list is used instead,
$client->refdb_dumpref( | $idlist$listname) ; |
removes references from personal reference list
specifies the ID values of the references to be dumped
the name of the personal list that the references should be added to. If this string is empty, the default personal list is used instead,
$client->refdb_getnote( | $type, | |
$format_string, | ||
$sort_string, | ||
$encoding, | ||
$limit_string, | ||
$query_string) ; |
retrieves references
select output format
specify additional fields to be retrieved
specify sorting key
the character encoding for the output data
Limits the matching datasets. Must be in the form 'limit[:offset]', where limit is the number of returned datasets, and offset the number of datasets to skip.
the query that describes the datasets to be retrieved
$client->refdb_countnote( | $listname, | |
$limit_string, | ||
$query_string) ; |
Counts matching extended notes
specify a list name if the search is to be confined to a particular personal reference list
Limits the matching datasets. Must be in the form 'limit[:offset]', where limit is the number of returned datasets, and offset the number of datasets to skip.
the query that describes the datasets to be counted
$client->refdb_selectdb( | $dbname) ; |
selects an existing database as the current database
name of the reference database
$client->refdb_texbib( | $style, | |
$cite_data) ; |
retrieves a bibliography in bibtex format based on citationlistx data
the name of the citation/bibliography style
XML data describing the references
$client->refdb_dbib( | $type, | |
$style, | ||
$encoding, | ||
$cite_data) ; |
retrieves an XML/SGML bibliography based on citationlistx data
type of the bibliography output
name of the citation/bibliography style
character encoding of the output data
XML data specifying the references