Ares Alma Barcode Lookup System Addon

NameAlma Barcode Lookup Addon
Version1.1.0
AuthorAtlas Systems, Inc.
DescriptionAn addon that takes an item barcode, performs an item search against the Alma API, and imports its results.

Developers

This addon is available for developers to modify and extend. Developers are encouraged to submit changes to this addon by forking the git repository from https://github.com/AtlasSystems/AlmaBarcodeLookup and creating a pull request.

Download

Configuration

Addon settings are configured in the Manage Addons form.

SettingDefaultTypeDescription
Alma API URL

String

The URL to the Alma API.

Alma API Key

StringAPI key used for interacting with the Alma API.
Allow Overwrite with Blank Value
True
BooleanIf turned on, empty values from the API response will overwrite any existing data. Note: Non-empty responses will always overwrite existing data.
Fields to Import
CallNumber, ISXN,
Title, Author,
Edition, Place,
Pages, and Publisher
String

This is a comma separated lists of the fields to import from the API response into the current product. The name of each field corresponds to the MappingName located in the DataMapping.lua file.

Field to Perform Lookup With
{Default}
String

This is the field in which the barcode is read from. You may specify a custom field or leave it as {Default} which will use the field outlined in DataMapping.lua.

The first value is the table in the database and the second value is the column.

Examples: {Default} (uses the field outlined in the DataMapping), Item.ItemBarcode, Transaction.ItemInfo1, or Transaction.Location

Data Mappings

Below are the default data mappings from the API response to Ares, Aeon, and ILLiad and the default location of the barcodes for each product. These data mappings can be changed in the DataMapping.lua file.

Caution

Be sure to backup the DataMappings.lua file before making modifications Incorrectly configured mappings may cause the addon to stop functioning correctly. 

Default Barcode Fields

Product DataMappingLocation
DataMapping.BarcodeFieldMapping["Ares"] Item.ItemBarcode
DataMapping.BarcodeFieldMapping["ILLiad"]Transaction.ItemNumber
DataMapping.BarcodeFieldMapping["Aeon"]Transaction.ItemNumber

Field Mappings

Mapping NameUsed to identify the mapping. The Fields to Import setting lists the Mapping Names for the addon to import.
Import Field

The Ares, Aeon, or ILLiad field the API response item maps to.

The first value is the table the field maps to and the second value is the desired column in the specified table.

Object TypeObject type is the name of the response type from the API response.
Object MappingThe XML node name of the data you wish to import.


Ares

Mapping NameImport FieldObject TypeObject Mapping
CallNumberItem.Callnumberitemcall_number
ISXNItem.ISXNitemissn
ISXNItem.ISXNitemisbn
TitleItem.Titleitemtitle
AuthorItem.Authoritemautho
EditionItem.Editionitemcomplete_edition
PlaceItem.PubPlaceitemplace_of_publication
PagesItem.PagesCountitempages
PublisherItem.Publisheritempublisher_const


ILLiad

Note

Because ILLiad supports multiple request types, separate mappings to both Loan and Article can be provided to the appropriate fields.

Mapping NameRequest TypeImport FieldObject TypeObject Mapping
AuthorLoanTransaction.LoanAuthoritemauthor
AuthorArticleTransaction.PhotoItemAuthoritemauthor
ISXNBothTransaction.ISSNitemissn
ISXNBothTransaction.ISSNitemisbn
EditionLoanTransaction.LoanEditionitemcomplete_edition
EditionArticleTransaction.PhotoItemEditionitemcomplete_edition
PagesBothTransaction.Pagesitempages
PlaceLoanTransaction.LoanPlaceitemplace_of_publication
PlaceArticleTransaction.PhotoItemPlaceitemplace_of_publication
PublisherLoanTransaction.LoanPublisheritempublisher_const
PublisherArticleTransaction.PhotoItemPublisheritempublisher_const
TitleLoanTransaction.LoanTitleitemtitle
TitleArticleTransaction.PhotoJournalTitleitemtitle
CallNumberBothTransaction.CallNumberitemcall_number


Aeon

Mapping NameImport FieldObject TypeObject Mapping
CallNumberTransaction.CallNumberitemcall_number
ISXNTransaction.ItemISxNitemissn
ISXNTransaction.ItemISxNitemisbn
TitleTransaction.ItemTitleitemtitle
AuthorTransaction.ItemAuthoritemautho
EditionTransaction.ItemEditionitemcomplete_edition
PlaceTransaction.ItemPlaceitemplace_of_publication
PagesTransaction.ItemPlaceitempages
PublisherTransaction.ItemPublisheritempublisher_const

FAQ

How to change the field that the barcode is read from?

The setting that determines the field that the barcode is read from is located in the addon's settings as "Field to Perform Lookup With". It takes in the word {Default} or the table name and the column name separated by a '.'.

By default it is {Default} which tells the addon to get the field from the DataMapping.lua file.

How to change the mappings of an API Lookup Response to Aeon, Ares, or ILLiad's field?

To modify the mappings in this addon, you must edit the DataMapping.lua file. Each mapping is an entry on the DataMapping.FieldMapping[Product Name] table.

Example data mapping table:

DataMapping.FieldMapping["Ares"] = {};
table.insert(DataMapping.FieldMapping["Ares"], {
MappingName = "CallNumber",
ImportField = "Item.Callnumber",
ObjectType = "item",
ObjectMapping = "call_number"
});

To modify the Aeon, Ares, or ILLiad field the API response item will go into, change the ImportField value to desired field. The ImportField formula is "{Table Name}.{Column Name}".

To modify the API response item to go into a particular Aeon, Ares, or ILLiad field, change the ObjectMapping value to the desired API XML node name.

How to change a mapping's name?

The mapping names can be modified to fit the desired use case. Just change the MappingName value to the desired name and be sure to include the new MappingName value in the "Fields to Import" setting, so the addon knows to import that particular mapping.

How to change the Default Barcode Field?

The default barcode field is defined in the DataMapping.BarcodeFieldMapping[{Product}] table within the DataMapping.lua file. To change the mapping, modify the respective variable to the "{Table}.{Column}" of the new field to be mapped to.

Addon Files

config.xmlThe addon configuration file.
DataMapping.luaThe data mapping file contains mappings for the items that do not typically change from site to site.
AlmaLookup.luaHandles the Alma-specific lookup logic
Main.luaThe Main.lua is the main file for the addon. It handles the initialization of the addon.
AlmaApi.luaThe AlmaApi file is used to make API calls against the Alma API
Utility.luaThe Utility file is used for common lua functions
LookupUtility.luaHandles generic lookup logic that can be used between services
WebClient.luaUsed for making web client requests.