User Tools

Site Tools


mozilla-devel:birds_eye_view

Bird's Eye View - API Calls and Fieldmapper Objects

I'm going to step back a bit here and go through the Open-ILS API and fieldmapper objects needed by the staff client. The staff client talks to various services (or applications) which register methods on an OpenSRF network in the open-ils namespace. Over the wire, data is sent between these services and the staff client as JSON arrays with class hints in surrounding comments (update: we're deprecating class hints and moving toward the current JSON standard). We have Fieldmapper classes written in several languages that turn these JSON arrays into objects based on the class hints. We call these Fieldmapper Objects.

Authentication

Application Method Parameters CVS
open-ils.auth open-ils.auth.authenticate.init login name C, Perl
open-ils.auth open-ils.auth.authenticate.complete login name, md5 hash C, Perl

The first thing the staff client does from a network perspective is talk to open-ils.auth.

open-ils.auth.authenticate.init

open-ils.auth.authenticate.complete

We send the login name through open-ils.auth.authenticate.init, do some md5 magic with the return value and the user supplied password, and send that back to Evergreen through open-ils.auth.authenticate.complete. If all goes well, we receive a session key that we can then use for authenticated methods to do more interesting things.

Data Initialization

Application Method Parameters CVS
open-ils.search open-ils.search.actor.user.session session key Perl
open-ils.actor open-ils.actor.groups.retrieve Perl
open-ils.actor open-ils.actor.user.ident_types.retrieve Perl
open-ils.actor open-ils.actor.standings.retrieve Perl
open-ils.search open-ils.search.config.copy_location.retrieve.all Perl
open-ils.search open-ils.search.config.copy_status.retrieve.all Perl
open-ils.actor open-ils.actor.org_tree.retrieve Perl
open-ils.actor open-ils.actor.org_types.retrieve Perl
open-ils.actor open-ils.actor.org_unit.full_path.retrieve session key Perl
open-ils.circ open-ils.circ.stat_cat.actor.retrieve.all session key, staff library id Perl

After the user is logged in, we start grabbing data that we'd like to cache in the client. Things like organization hierarchy, a list of copy locations, ID types, etc.

open-ils.search.actor.user.session

This method returns most of the user data for the person logged in (the user associated with the session key). This data is returned as a fieldmapper object with the shortname of "au", but otherwise known as Fieldmapper::actor::user on the server side of Evergreen. In the following table, *'s indicate "virtual" fields, which are usually just empty placeholders to hang other fieldmapper objects. A "fleshed" fieldmapper object is one where some or all of these virtual fields are filled in.

Fieldmapper::actor::user Description
auactive Is this user account enabled?
auaddresses * Virtual field containing "aua" objects
aualert_message Text string to alert to staff when this user is accessed
aubilling_address Null or index into .addresses()
aucardIndex into .cards()
aucards * Virtual field containing the library cards (fieldmapper "ac") associated with the user
aucheckouts * Virtual field containing the user's checkouts
auclaims_returned_countThe number of times the user has claimed an item has been returned despite indications to the contrary
aucreate_dateThe date the user was created
aucredit_forward_balanceThe monetary credit associated with the user
auday_phone
audobDate of Birth
auemail
auevening_phone
auexpire_dateThe date the user's priveledges are set to expire
aufamily_name
aufirst_given_name
auhold_requests * Virtual field containing item hold requests ("ahr") for the user
auhome_ouContains the id for the user's home organizational unit
auidThe primary key for the user record
auident_typeUsers have two slots for identification. We segregate type and value.
auident_type2Id for a "cit" object
auident_value
auident_value2
auischanged * Standard fieldmapper field to help process objects.
auisdeleted * ""
auisnew * ""
aulast_xact_id
aumailing_addressNull or index into .addresses()
aumaster_accountIs this the primary user for a group?
aunet_access_level
auother_phone
aupasswd
auphoto_url
auprefixMr., Mrs., etc.
auprofileThe primary permission/user group associated with the user.
ausecond_given_name
ausettings *
austanding
austat_cat_entries *
ausuffixJr., Sr., etc.
ausuper_userIs this user a super user?
ausurvey_responses *
auusrgroup
auusrnameOPAC/staff client login name for this user

open-ils.actor.groups.retrieve

This method returns an array of Fieldmapper::permission::grp_tree (or "pgt") objects. These objects are a hierarchal set of permission groups that users may belong to, such as Patrons, Staff, Catalogers, and Circulators.

Fieldmapper::permission::grp_tree
pgtdescription
pgtid
pgtischanged *
pgtisdeleted *
pgtisnew *
pgtname
pgtparent

open-ils.actor.user.ident_types.retrieve

This method returns an array of Fieldmapper::config::identification_type (or "cit") objects. These classify various types of identification that can be associated with a user, such as Driver's License or SSN.

Fieldmapper::config::identification_type
citid
citischanged *
citisdeleted *
citisnew *
citname

open-ils.actor.standings.retrieve

This method returns an array of Fieldmapper::config::standing (or "cst") objects. These are used to describe a user's standing for the purpose of granting library priveledges. Currently we have "Good" and "Barred".

Fieldmapper::config::standing
cstid
cstischanged *
cstisdeleted *
cstisnew *
cstvalue

open-ils.search.config.copy_location.retrieve.all

This method returns an array of Fieldmapper::asset::copy_location (or "acpl") objects. These are copy locations associated with items. The only PINES-wide default is "Stacks".

Fieldmapper::asset::copy_location Description
acplcirculateCan items in this location circulate?
acplholdableAre items in this location holdable?
acplid
acplischanged *
acplisdeleted *
acplisnew *
acplname
acplopac_visibleAre items in this location visible in the OPAC?
acplowning_libId for the "aou" associated with this location

open-ils.search.config.copy_status.retrieve.all

This method returns an array of Fieldmapper::config::copy_status (or "ccs") objects. These are statuses associated with items, such as Checked Out, Lost, Missing, In Process, In Transit, etc.

Fieldmapper::asset::copy_status Description
ccsholdableAre items with this status holdable?
ccsid
ccsischanged *
ccsisdeleted *
ccsisnew *
ccsname

open-ils.actor.org_tree.retrieve

This method returns a "fleshed" Fieldmapper::actor::org_unit (or "aou") object containing the whole organization tree for the consortium. The objects are linked through the parent_ou field (points to a single "aou") and the children field (contains an array of "aou" objects).

Fieldmapper::actor::org_unit
aoubilling_address
aouchildren *
aouholds_address
aouid
aouill_address
aouischanged *
aouisdeleted *
aouisnew *
aoumailing_address
aouname
aouou_type
aouparent_ou
aoushortname

open-ils.actor.org_types.retrieve

This method returns an array of Fieldmapper::actor::org_unit_type (or "aout") objects, which classify the different types of "aou"'s. We currently have "Consortium", "System", "Branch", "Bookmobile", and "Sub-lib".

Fieldmapper::actor::org_unit_type
aoutcan_have_users
aoutcan_have_vols
aoutchildren *
aoutdepth
aoutid
aoutischanged *
aoutisdeleted *
aoutisnew *
aoutname
aoutopac_label
aoutparent

open-ils.actor.org_unit.full_path.retrieve

This method returns a flat array of Fieldmapper::actor::org_unit (or "aou") objects associated with the sessioned user. For example, a user with a home org unit of ARL will have all the ARL-branch libraries in this list, as well as the PINES consortium as the top-level org unit.

open-ils.circ.stat_cat.actor.retrieve.all

This method returns an array of Fieldmapper::actor::stat_cat (or "actsc") objects associated with the sessioned user's home org unit. These objects are Statistical Categories defined by the libraries and intended for local reporting, and these in particular get associated with patrons.

Fieldmapper::actor::stat_cat
actscentries *
actscid
actscischanged *
actscisdeleted *
actscisnew *
actscname
actscopac_visible
actscowner

Check Out

Application Method Parameters CVS
open-ils.actor open-ils.actor.user.fleshed.retrieve_by_barcode session key, barcode Perl
open-ils.circ open-ils.circ.actor.user.checked_out session key, "au" id Perl
open-ils.circ open-ils.circ.permit_checkout session key, item barcode, "au" id, number of open async checkout requests Perl
open-ils.circ open-ils.circ.checkout.barcode session key, item barcode, "au" id Perl

open-ils.actor.user.fleshed.retrieve_by_barcode

The checkout interface needs to retrieve the "au" object for the patron. If this has not already been provided (by say, a different interface), we can use this method to retrieve the patron by their library card barcode. The "fleshed" part is the au's .cards(), .addresses(), and .stat_cat_entries() fields.

open-ils.circ.actor.user.checked_out

Though not strictly needed for a checkout interface, this method returns the patron's current checkouts. It actually returns an array of useful composite objects. Each object contains 3 fields (circ, copy, and record), each containing a fieldmapper object.

circ
copy
record

circ

The circ field contains a Fieldmapper::action::open_circulation (or "aoc") object. This represents the actual transaction for the circulating item, and contains information such as what circulation rules are associated with the checkout, the due date, the library that checked the item out, etc. In the database, open_circulations are technically a view of circulations, which is why the various checkin fields are listed. They should contain null's in this case. Similarly, .xact_finish() should be null.

Fieldmapper::action::open_circulation
aoccheckin_lib
aoccheckin_staff
aoccheckin_time
aoccirc_lib
aoccirc_staff
aocdesk_renewal
aocdue_date
aocduration
aocduration_rule
aocfine_interval
aocid
aocischanged *
aocisdeleted *
aocisnew *
aocmax_fine
aocmax_fine_rule
aocopac_renewal
aocphone_renewal
aocrecuring_fine
aocrecuring_fine_rule
aocrenewal_remaining
aocstop_fines
aocstop_fines_time
aoctarget_copy
aocusr
aocxact_finish
aocxact_start

copy

The copy field contains a Fieldmapper::asset::copy (or "acp") object. This represents the actual item in the database, and has information such as the item's barcode, shelving location, stat cat entries, etc.

Fieldmapper::asset::copy
acpbarcode
acpcall_number
acpcirc_as_type
acpcirc_lib
acpcirc_modifier
acpcirculate
acpcopy_number
acpcreate_date
acpcreator
acpdeposit
acpdeposit_amount
acpedit_date
acpeditor
acpfine_level
acpholdable
acpid
acpischanged *
acpisdeleted *
acpisnew *
acploan_duration
acplocation
acpopac_visible
acpprice
acpref
acpstat_cat_entries *
acpstatus

record

The record field contains a Fieldmapper::metabib::virtual_record (or "mvr") object. This is basically bibliographic data about the title record to which the copy belongs. It contains information such as the title and author of the work, the ISBN, subject headings, etc.

Fieldmapper::metabib::virtual_record
mvrauthor *
mvrcall_numbers *
mvrcopy_count *
mvrdoc_id *
mvrdoc_type *
mvredition *
mvrisbn *
mvrischanged *
mvrisdeleted *
mvrisnew *
mvronline_loc *
mvrpubdate *
mvrpublisher *
mvrserials *
mvrseries *
mvrsubject *
mvrsynopsis *
mvrtcn *
mvrtitle *
mvrtypes_of_resource *

open-ils.circ.permit_checkout

This method does a basic permissibility test against the item and the patron. Can this patron check out this item? One of the permissibility rules is concerned with the total number of items a patron has checked out. The first prototype of the staff client called this method asychronously, so I believe the thought was that we needed an argument to tell the method how many "outstanding" or unprocessed checkout attempts were queued up, so we could potentially count that number against the total number of checked out items. We should probably revisit this to double-check what we were thinking, and see if it is still needed and/or implemented correctly.

The method returns a simple object containing a status field and a corresponding text field. A status of 0 means that the patron is permitted to checkout the item.

status
text

open-ils.circ.checkout.barcode

This method attempts the actual checkout of an item to a patron. Like the open-ils.circ.actor.user.checked_out method, it returns a composite object (circ, copy, and record) with various fieldmapper objects. The copy field holds a Fieldmapper::asset::copy (or "acp") object. The record field contains a Fieldmapper::metabib::virtual_record (or "mvr") object. However, the circ field contains an actual Fieldmapper::action::circulation (or "circ") object instead of its open circulation subclass.

circ
copy
record

circ

Fieldmapper::action::circulation
circcheckin_lib
circcheckin_staff
circcheckin_time
circcirc_lib
circcirc_staff
circdesk_renewal
circdue_date
circduration
circduration_rule
circfine_interval
circid
circischanged *
circisdeleted *
circisnew *
circmax_fine
circmax_fine_rule
circopac_renewal
circphone_renewal
circrecuring_fine
circrecuring_fine_rule
circrenewal_remaining
circstop_fines
circstop_fines_time
circtarget_copy
circusr
circxact_finish
circxact_start

Check In

Application Method Parameters CVS
open-ils.actor open-ils.actor.user.fleshed.retrieve session key, "au" id
open-ils.circ open-ils.circ.checkin.barcode session key, barcode, renewal?, backdate
open-ils.circ open-ils.circ.hold.capture_copy.barcode session key, item barcode, retrieve?

open-ils.actor.user.fleshed.retrieve

open-ils.circ.checkin.barcode

open-ils.circ.hold.capture_copy.barcode

Application Method Parameters CVS
open-ils.actor open-ils.actor.patron.search.advanced session key, criteria hash
open-ils.actor open-ils.actor.user.fleshed.retrieve session key, au id

open-ils.actor.patron.search.advanced

Internally this method is implemented with open-ils.storage.actor.user.crazy_search, and we'll need to ask Mike why he named it such. :D The search hash contains keys that correspond to the fields to search. For example, family_name, email, or first_given_name. Each key indexes an object containing two fields, value and group. Value contains the value for the field to search for. Group contains a number 0-2, which helps crazy_search determine which table the field goes with. Group 0 are real fields directly on the "au" object. Group 1 are address fields. Group 2 are phone numbers and ID values.

Here's an example search hash:

 { 'phone' : { 'value' : '555-5555', 'group' : '2' } }

There's no single "phone" field on an "au" object. Instead, crazy search must look at day_phone, evening_phone, and other_phone. Similarly, address fields look at all addresses attached to a user.

This method returns a list of "au" id's.

open-ils.actor.user.fleshed.retrieve

Similar to open-ils.actor.user.fleshed.retrieve_by_barcode, this method takes an au id as the selection criteria, and returns an "au".

mozilla-devel/birds_eye_view.txt · Last modified: 2022/02/10 13:34 by 127.0.0.1

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

© 2008-2022 GPLS and others. Evergreen is open source software, freely licensed under GNU GPLv2 or later.
The Evergreen Project is a U.S. 501(c)3 non-profit organization.