open-library-connector
Service icon

Open Library Connector

version 1.0.0 (Compatible with OutSystems 11)
Published on 12 Jan (2 weeks ago) by 
5.0
 (2 ratings)
open-library-connector

Open Library Connector

Details
This connector retrieves online book information with a given and validated ISBN from the OpenLibrary Books API and converts it into a structure, so applications can be build with already available book data and structures, instead of writing it manually. Also a dynamic JSON is retrieved as a Text from the generic OpenLibrary Books API so users can build their own structures for book representations.
Read more


Open Library Connector



Version: 1.0.0


This connector retrieves online book information with a given and validated ISBN from the OpenLibrary Books API and converts it into a structure, so applications can be build with already available book data and structures, instead of writing it manually. Also a dynamic JSON is retrieved as a Text from the generic OpenLibrary Books API so users can build their own structures for book representations.


How to use


  1. Install the Open Library Connector component from the forge
  2. In the application module, that needs to use the Open Library Connector, go to "Manage Dependencies" (Ctrl + Q)
  3. Search for "Open Library Connector" under "Show All"
  4. Check every element (e.g. server action) you to consume in the module
  5. Press Apply


Provided server actions


  • GetBookFromOpenLibrary
  • GetBookFromOpenLibraryJSON


Provided structures


  • ExampleBook




Server actions


GetBookFromOpenLibrary

This server action retrieves information in JSON format from a book found with the given ISBN, after it passed the CheckISBN action. It then deserializes the JSON into an ExampleBook structure, to represent the book information and returns it to the consuer module. This then can be used by the module for further devlopment.


Input

- isbn - Text

Output

- Book - ExampleBook Structure 


Example inputs

  • 978-3-16-148410-0
  • 9783453127012
  • 9783453198876


Possible thrown exceptions

  • ISBNNotValidException
  • BookNotFoundException




GetBookFromOpenLibraryJSON

This server action retrieves information in JSON format from a book found with the given ISBN, after it passed the CheckISBN action. It then returns the JSON Text to the consumer module. This then can be used for further development. For example the module can create its own structures to represent the book information flexible in different ways.


Input

- isbn - Text

Output

- BookJSON - Text


Example inputs

  • 978-3-16-148410-0
  • 9783453127012
  • 9783453198876


Possibly thrown exceptions

  • ISBNNotValidException
  • BookNotFoundException




CheckISBN

This action simply checks if the given ISBN has more than 17 characters. If so the ISBN is not valid and isValid is set to False.


Input

- isbn - Text

Output

- isValid - Boolean


Why 17?

ISBN-13 has 13 digits. ISBN13 may have up to four hyphens, resulting in extra characters beside the 13 digits.

Why data type Text?

ISBN-13 may have hyphens, that can not be represented with Integer. An error will be thrown when tried.

ISBN-10 may have a leading 0 (Zero). With the Integer data type the leading 0 will be cut away: 012345 -> 12345. This will found no or a wrong book.




Structures


ExampleBook

Structure representation of a book with several attributes.


bib_key - Text

- Given ISBN and key for the found book in Open Libray

title - Text

- Title of the book

author - Text

- Name of the book author

publisher - Text

- Name of the book publisher

publish_date - Text

- Date when the book was published

language - Text

- Language of the book

pages - Integer

- Number of pages in the book

info_url - Text

- Link to the information site of Open Library for the found book

preview_url - Text

- Link to a preview site of the book

thumbnail_url - Text

- Link to the book cover image. Can be used for an external image

isbn_13 - Text

- ISBN-13 representation of the book

isbn_10 - Text

- ISBN-10 representation of the book




Exceptions


ISBNNotValidException

Thrown when ISBN has not passed the CheckISBN action. The GetBookFromOpenLibrary* actions will when abort and throw the Exception.

Possilbe reasons:

  • ISBN length > 17



BookNotFoundException

Thrown when no book was not found.

Possible reasons:

  • OpenLibray doesn't has the book in their database
  • ISBN passed the CheckISBN action but has no reference to a book. No book exists for this ISBN (e.g. 9123456789)
What’s new (1.0.0)
Reviews (0)