The Banner view that Scott Wood assembled for the library, aka allBannerInfo.txt, includes the following fields. The number indicates their positions in the array and the field names in the users db table are in bold:

  • 0 - barcode: barcode
  • 1 - altID: externalSystemId
  • 2 - ?cred: 
  • 3 - last name: personal.lastName
  • 4 - first name: personal.firstName
  • 5 - middle name: personal.middleName
  • 6 - suffix: 
  • 7 - street1: personal.addresses.addressLine1 *
  • 8 - street2: personal.addresses.addressLine2
  • 9 - city: personal.addresses.city
  • 10 - state: personal.addresses.region
  • 11 - zip: personal.addresses.postalCode
  • 12 - country: personal.addresses.countryId
  • 13 - phone: personal.phone
  • 14 - campus address: personal.addresses.addressLine1 **
  • 15 - campus address: personal.addresses.addressLine1 **
  • 16 - campus address: personal.addresses.addressLine2 **
  • 17 - campus phone area code ***
  • 18 - campus phone number ***
  • 19 - student if Y
  • 20 - employee if Y
  • 21 - employee role: if FACULTY patronGroup = Faculty; if LIBRARY patronGroup = Library Faculty and Staff; if STAFF patronGroup = Staff
  • 22 - student program code
  • 23 - program / major: departments
  • 24 - school: if C patronGroup = CLA; if G  patronGroup = CSGS; if T patronGroup = Theo
  • 25 - email address: personal.email; parsed to provide JSON with a username
  • 26 - anticipated graduation date
  • 27 - alumni if Y

in order to create a user either 19 or 20 must be Y.

* 7-12 : addressType = Home; personal.addresses.primaryAddress = true

** 14 & 15 : addressType = Campus; these two fields need to be parsed together if there is any data in either one of them

*** 17 & 18 : if their is a campus phone number it should be put in personal.phone rather than the phone number in 13

JSON fields not informed by the above include

  • active = true
  • type = patron
  • personal.preferredContactTypeId = 002 (email)
  • expirationDate: 2/15/2021 for students; 3/15/2021 for employees

The previous version of FOLIO (Fameflower) required me to craft the user's UUID and I am very happy to discover that the current version (Goldenrod) does not. I'm putting my solution to crafting a UUID here so that I will always have it and never need it again:


sub craft_uuid {
$uuid = "";
$m = "12345";
$n = "89abAB";
$x = "0123456789abcdefABCDEF";
for ($y = 1; $y <= 8; $y++) {$r = int(rand(22)); $uuid .= substr($x,$r,1);}
$uuid .= "-";
for ($y = 1; $y <= 4; $y++) {$r = int(rand(22)); $uuid .= substr($x,$r,1);}
$uuid .= "-";
$r = int(rand(5));
$uuid .= substr($m,$r,1);
for ($y = 1; $y <= 3; $y++) {$r = int(rand(22)); $uuid .= substr($x,$r,1);}
$uuid .= "-";
$r = int(rand(5));
$uuid .= substr($n,$r,1);
for ($y = 1; $y <= 3; $y++) {$r = int(rand(22)); $uuid .= substr($x,$r,1);}
$uuid .= "-";
for ($y = 1; $y <= 12; $y++) {$r = int(rand(22)); $uuid .= substr($x,$r,1);}
$json = `curl -s -w '\n' -X GET -H '$jsonHeader' -H '$xOkapiToken' $baseURL/users/$uuid`;
}
for ($infinity = 0; $infinity <= 1; $infinity++) {
craft_uuid();
if ($json =~ /Not found/) {
$infinity++;
} else {
$infinity--;
}
}



  • No labels