Skip to content

Latest commit

 

History

107 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

Setup CarlX API scripting Windows PowerShell environment built on ActiveState Platform State Tool. Active State Platform and state tool maintain the security and validity of the script components - a useful feature among scripting environments. These CarlX API based scripts use the ActiveState Perl programming lanuage run from Windows CMD or Powershell. Goal: make CarlXAPI functions available to CarlX library staff having access to the CarlX API and Windows command line. No need to install or learn Perl, the State Tool behind the curtain does it for you. Just find the name of the desired function like PatronAllowEmail or PatronSendHoldAvailable and provide a csv file with the PatronIDs.

CarlXAPI Perl Source Github

ActiveState Platform

ActiveState Perl

Note that under Windows the ActiveState Platform State Tool can conflict with tools like mingw, cygwin, and Strawberry Perl. After one-time installation, a CarlX library staff person will run a CarlX API perl script with an input csv file. This example adds a standard note to every patron account with patronID present in the first column of file wilAddNote.csv. Note that the CSV file coding must use iso-latin-1-dos / ISO 8859 1 or the perl script will fail

perl AddNoteGrad.pl -g wilAddNote.csv

One time Setup of the ActiveState State Tool Perl Environment.

Open a PowerShell Window and temporarily allow execution of remote Scripts

set-executionpolicy bypass -Scope Process

Copy Environment Setup Script to Your Project Directory, e.g.

cp $HOME/downloads/carlxapienv.ps1 $HOME/apiprojects

Change Directory to Run the environment setup script. It will create a directory named carlxapi for the perl files.

cd $HOME/apiprojects

.\carlxapienv.ps1

Confirm that perl is installed and running.

Open a New PowerShell Session. Change to the Project Directory cd $HOME/apiprojects/carlxapi

Run a smoke test to get the Perl version and check syntax of an API script

perl -v

perl -c AddNoteGrad.pl

Running API commands after completion of one-time setup.

Command Format to run API script. Done for any run of the script.

Run a script using an input CSV file. Use your own CSV with parameters like PatronID, ItemID, Call Number, and NoteID. Should add a Standard Note to the Patron Accounts in the file, in this case a single patron.

perl AddNoteGrad.pl -g wilAddNote.csv

Input CSV file example

wilAddNote.csv has a single PatronID but it could have multiple, one PatronID per line.

11982021684457

Uninstall steps PowerShell

state clean uninstall -a

rmdir CarlXAPI

Scripts to use

AddNoteGrad.pl

adds General Note to Graduated Student patron account. Typically done after FCPS identifies graduated students in June or July.

patronAllowEMailMCE.pl

Allows patron account to receive email

patronSendHoldAvailable

Allows patron account to receive hold available message

settleFinesAndFeesMCE.pl

Settles fines in a Patron account. Needs CSV input file with PatronID, Fine ID, and fine amount

Accepts an input file of the Patron ID, Item Id starting with #177. Needs and prompts for CarlXAPI password.

PATRONID,HASH177,FINEAMOUNT,FINEDATE,ITEM,NAME,STATUS,BTYCODE,EDITDATE,ACTDATE

DeleteNoteMCE.pl

Delete patron note identified by noteID. Accepts input file of NoteIDs

UpdateItemMCE.pl

Updates item records with new Call Number. Accepts input file of ItemIDs and the new Call Number value.

About

Perl scripts to maintain CarlX ILS via CarlXAPI: PatronAPI, ItemAPI

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Contributors

Languages