BibCatalog API


BibCatalog supports "ticketing" so that cataloguers can keep track of their tasks.
Of several ticketing systems, RT (Request Tracker) is currently supported.

1. The API
bibcatalog.py consist of ticket operations, as follows.

    * check_system(uid) returns an empty string if things are OK, and an error string otherwise.
    * ticket_search(uid, recordid, subject, text, creator, owner, date_from, date_until,
                    status, priority) search tickets by various criteria.
    * ticket_submit(uid, subject, recordid, text, queue, priority, owner)
                    submit a ticket and initially set its fields.
    * ticket_assign(uid, ticketid, to_user) assign a ticket to someone.
    * ticket_set_attribute(uid, ticketid, attribute, new_value) sets an attribute.
                    These are members of TICKET_ATTRIBUTES in bibcatalog_system.py.
    * ticket_get_attribute(uid, ticketid, attrname) returns the value of an attribute.
    * ticket_get_info(uid, ticketid, attrlist) return ticket information as a dictionary.

2. Configuring your access to RT

To use the BibCatalog module you first need to set up the ticket system you want to use (currently only RT).

Edit these lines in invenio.conf:

CFG_BIBCATALOG_SYSTEM = RT
CFG_BIBCATALOG_SYSTEM_RT_CLI = /usr/bin/rt
CFG_BIBCATALOG_SYSTEM_RT_URL = http://xxx.server.org/rt3

Your RT installation does not need to be in the same computer where
your Invenio installation is. However, you will need the CLI (/usr/bin/rt)
Perl program.

3. Configuring RT

RT version 3 has been tested with this installation.

There are two custom fields in tickets. These should be created by the administrator by
using the "Admin/CustomFields" URL in RT. The fields are:
(i) name: RecordID - applies to: tickets
(ii) name: TicketSetID - applies to: tickets

In general, the invenio cataloguers need to have the right to submit/create tickets in the queues.
Creating users is done by RT admin using the "Admin/Users" URL.
Ticket creation etc should be enabled by giving the following rights to group "Everyone" in queues:
AssignCustomFields
CommentOnTicket
CreateTicket
ModifyTicket
ReplyToTicket

4. Using the API


from invenio.bibcatalog.bibcatalog import BIBCATALOG_SYSTEM

if BIBCATALOG_SYSTEM is not None:
	uid = 1 #or whatever..
	x = BIBCATALOG_SYSTEM.check_system(uid)
	if len(x) > 0:
	    print "errors: "+str(x)
	    sys.exit()
	else:
	    print "ok"