Scripting

<< Click to Display Table of Contents >>

Navigation:  Entrance software >

Scripting

Previous pageReturn to chapter overview

The Entrance software allows scripting, to modify identifiers read from the patron reader. This would typically be used in situations where the identifier - barcode or RFID - is not exactly in the same format on the card as it is in the library system. For example, this could be a barcode format with check digits; scripting allows the check digits to be removed before sending any SIP messages.

 

A default script named CardScript.cs is created on install, and located in <ProgramData>\PV-Supa\SelfOperatedLibraryEntrance folder on the computer where the Entrance software is installed. It is a C# (.NET) script which will be read and compiled at the startup of the Entrance software. Any compilation errors will be shown in the logs.

 

In the script file, there is a method Convert(string text, int info) which does the converting. Following is a sample of what that method would look like if the case was to remove any digits after the first 11:

 

        public string Convert(string text, int info)

        {

            if (text.Length > 11)

                return text.Substring(0, 11);

            else

                return text;

        }

 

To enable the script method to be used, save the modified script file over the default one. In Management utility, set setting SelfOperatedLibraryEntrance / Patron card script mode to Use script and restart the entrance application. If a patron card is now read, having more than 11 digits, it will be cut to exactly 11 digits.