Build Room Reservation System using Sierra REST API


2016 SCIUG Conference at Loyola Marymount University (Oct. 14)

Created by Seong Heon Lee, Systems & Technology Librarian Hugh & Hazel Darling Law Library, Chapman University

Final Product

LibCal Room Booking system

Why Did We Start?

An Email from David, Circulation Librarian

"We notice a strange problem with the Law School’s Study Room Reservation module. Apparently if you make a 1 session at 8am it will reserve the room for the entire day. At any other time of the day you can make a 1 hour session with no problem. When you get a chance would you look into this?"

Reply to David

"Thanks David for the notification. Anthony seems out of office till 6/21. Will Keep you posted."

... A Week After (6/25/2015)

David: Okay it looks like the problem has been fixed. Also, it looks like Bill was the one who resolved it instead of Anthony.

Me: Great! Thanks for informing this.


... Two Weeks Later (7/10/2015)

David: It looks like there is another problem. I don’t know if this is related to the problem we had before. It seems if you make a reservation that ends at 10pm, it will not show the reservation for the last hour.

David emailed to IT to check the problem.

... A Week Later (7/16/2015)

Me: Did IT fix this problem?

... Another Week Later (7/23/2015)

David: Anthony, do you know the status of this case?

... Another Two Weeks Later (8/7/2015)

Me: Did IT fix the problem?

David: Not yet. Anthony said that he would get back to me past Monday, but I didn’t hear from him.

... A semester started,
while the system was still broken

... About a month later (Sep. 21)

Email from IT

Would you write STEP-BY-STEP procedure of making a reservation?

Summary of the Story

Manage Library Technology


Internally

vs.

Outsourcing

So, we questioned:

Do we need a new system?

How Did We Start?

First, disucss available options.

Three options:

  1. Fix it
  2. Leatherby's
  3. Other Alternatives

LibCal as a Candidate

Testing LibCal

  • Intuitive and flexible Admin Pages and Features
  • Bundled with other sister products, such as calendar, appointment
  • Booking widgets embeddable on other websites
  • Limit access by domains (e.g. @mail.chapman.edu)
  • User authentication module, LibAuth
  • Reliable Supports: users and software

User Authorization

  1. Open login (default): name and email
  2. Restricting by domain: @mail.chapman.edu
  3. Third-Party Integration: Shibboleth, LDAP, SAML, CAS, SIP2, and a remote self-hosted script option

Remote Self-Hosted Script

"The self-hosted option is for if you have a custom configuration that's not covered by the other options. What we do is POST the username and password to a remote URL you host. We recommend that the authentication returns json formatted like..."


				{
				"firstname":"James",
				"lastname":"Bond",
				"email":"jbond@007.com",
				"auth":true
				}
				

Sierra REST APIs

Web App

What does the Web App do?

  1. Receive an user request from LibCal
  2. Pass the user request to Sierra REST API
  3. Receive user data from Sierra REST API
  4. Process user data in the format that LibCal requires
  5. Return user data to LibCal

Code View of Each Step

Behind the Project

  • A Short Code with Patron Find API
  • No access to Patron Find API till the 28th of July 2016
  • Patron Find API available with Sierra 2.2
  • Sierra's full OS upgrade
  • Developer Sandbox
  • Local Custom Patron API

A Custom Patron API

Extract data (law students) from Sierra PostgreSQL

Send data to LibCal

Accidental Invention

Custom Patron API
AS
Offline Service

Offline Service

Go Live!

Development vs Production

4 Second Timeout Issue

Don't expect that your code in the development environment works in the same way that it works in the production server.

  • Unknown rules: 4 second timeout
  • IIS Process Recycling
  • their party apps: Virus-Scanning

Automatic request script

Monitoring the App on Server

  • Who access?
  • Requestor IP
  • Response Time
  • Simple View for Quick Review

IIS Web Server Logs

Code of Log Analyzer

Log Looks Like

REST API

  • Representational State Transfer
  • Web Architectural Style with 6 contraints: client-server, stateless, cashable, uniform interface, layered system, and code on demand


  1. Separation of Concerns (client vs server)
  2. Stateless (No meddling each other)
  3. HTTP Protocol (Get, Post, Put, Delete)

Representation & Resource

REST and Buffet

food (resources) are served at the bars (endpoints)

Sierra Developer Sandbox

Other REST APIs

Why REST APIS:

Access to Existing Data

(e.g. Sierra Patron Records)

Why REST APIS:

Reuse the data in different apps

(e.g. Patron Authorization Web App)

Why REST APIS:

Integrate different systems

(e.g. LibCal/LibAuth and Sierra)

The End