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.
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
set-executionpolicy bypass -Scope Process
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
Open a New PowerShell Session.
Change to the Project Directory
cd $HOME/apiprojects/carlxapi
perl -v
perl -c AddNoteGrad.pl
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
wilAddNote.csv has a single PatronID but it could have multiple, one PatronID per line.
11982021684457
state clean uninstall -a
rmdir CarlXAPI
adds General Note to Graduated Student patron account. Typically done after FCPS identifies graduated students in June or July.
Allows patron account to receive email
Allows patron account to receive hold available message
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
Delete patron note identified by noteID. Accepts input file of NoteIDs
Updates item records with new Call Number. Accepts input file of ItemIDs and the new Call Number value.