Export Patron Stat Cats via SIP

Bug #776583 reported by Thomas Berezansky
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Wishlist
Bill Erickson

Bug Description

The attached patch adds support for exporting patron statistical categories via SIP2.

By default I am not defining any field identifiers for export, and have not created an interface for defining fields. Direct DB queries to insert into actor.stat_cat_sip_fields will be needed to do that configuration at this time. Careless choice of field identifier can cause issues if it conflicts with any standard or extension field already in use.

Once one or more fields are defined they can be assigned with the normal stat cat editor, and the SIPServer code (with the extra patch it needs for extra fields support) will be able to load information from the stat cats.

Each stat cat also has a sip format string. That string can be a simple string or can use %s to include the actual stat cat value.

Use case, for us, is "Library wants SIP to provide information on members of friends group". Make a stat cat for the friends group with a SIP field identifier and the library name as the format string. Then instruct the library to put the date in the stat cat. SIP responses should then include the new field with the library name for members of the friends group. This can then be matched by the SIP requester and used to identify a friends group member.

Signed-off-by: Thomas Berezansky <email address hidden>

For those who want to use git to pull my git branch:

To add my remote using id "tsbere" (only needs to be done once):

git remote add tsbere git://git.mvlcstaff.org/tsbere/ILS

If you don't use tsbere as the identifier here all of the below commands referring to tsbere will need to be adjusted.

Don't forget to fetch/update the remote:

git fetch tsbere
OR
git fetch --all

This branch will be tsbere/sip_statcats

To check out the branch:

git checkout -b tsbere_sip_statcats tsbere/sip_statcats

To merge into your current branch (change branches first!):

git merge tsbere/sip_statcats

To merge changes you made to your checked out version into the current branch (change branches first!):

git merge tsbere_sip_statcats

Revision history for this message
Thomas Berezansky (tsbere) wrote :
Revision history for this message
Thomas Berezansky (tsbere) wrote :

Updated with a new git branch to include copy stat cats as well.

New branch is sip_statcats2

Also on git.evergreen-ils.org, repo working/Evergreen.git, branch <email address hidden>/sip_statcats2

Bill Erickson (berick)
Changed in evergreen:
assignee: nobody → Bill Erickson (erickson-esilibrary)
Revision history for this message
Bill Erickson (berick) wrote :

Hi Thomas, I have reviewed the branch. I just have a few comments regarding the implementation.

1. Avoid the use of the open-ils.storage service when possible. For typical data retrieval and update, use either open-ils.pcrud or a combination of Perl middle-layer and open-ils.cstore.

A pcrud equivalent to open-ils.circ.stat_cat.actor.sip_fields.retrieve.all:

srfsh% request open-ils.pcrud open-ils.pcrud.search.actscsf.atomic "authtoken", {"field":{"!=":null}}

Using this, you don't need open-ils.circ.stat_cat.*.sip_fields.retrieve.all or open-ils.storage.*.stat_cat_sip_fields.retrieve.all

2. If the data retrieval is more complex than open-ils.pcrud can manage or you prefer to keep the Perl middle-layer call for consistency, etc., use cstore with CStoreEditor. See "open-ils.acq.picklist.create" as a typical example of CStoreEditor usage.

Otherwise, I think the patch looks great.

tsbere++

-b

Changed in evergreen:
status: New → Triaged
Revision history for this message
Thomas Berezansky (tsbere) wrote :

Per your suggestion/request I have swapped to using pcrud calls, removing most of the open-ils.storage-related changes outright.

I have replaced the sip_statcats2 branch(es) with the new version (rebased in part to put the two commits on top, and in part because of how I worked on it).

Revision history for this message
Bill Erickson (berick) wrote :

I've pushed the patch to 'master'.

Changed in evergreen:
status: Triaged → Fix Committed
Revision history for this message
Bill Erickson (berick) wrote :

Commits for reference: 260d422..7d1040a

Changed in evergreen:
milestone: none → 2.2.0
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.