It got me to thinking, what if I read an excel file of barcodes of patrons which we want to delete, and basically sent a deleteUser call based on the userID to the Alma user web service.
Below are the steps we used:
- First we installed PHPExcel 1.7.9. This lets us easily read through the spreadsheet.
- Using Alma Analytics we created a spreadsheet of the users that we wanted to delete.
- Next we set up a file to make the call to the UserWebServices wsdl.
- There are a number of functions available on from the web service and one is "deleteUser".
- So we basically read through the excel file and delete each patron record. If success, we report back the ID that was deleted. If the delete fails, books on loan, patron has fines, or the user id no longer exists the report lets you know who it could not delete and the reason why it failed.
Here is a sample of the report:
UserID 2044325 HAS been deleted
UserID 2045274 HAS been deleted
UserID 2046383 HAS been deleted
UserID 2046389 HAS been deleted
UserID 2046625 HAS been deleted
UserID 2046757 HAS been deleted
UserID 2046897 Could not be deleted because User not found
UserID 2046918 Could not be deleted because User not found
UserID 2048022 HAS been deleted
UserID 2048028 Could not be deleted because User not found
UserID 2048220 Could not be deleted because User not found
UserID 2049102 Could not be deleted because User not found
UserID 2049493 Could not be deleted because User not found
UserID 2058282 Could not be deleted because User not found
UserID 1694234 Could not be deleted because User not found
UserID 1856181 Could not be deleted because User not found
UserID 2114672 Could not be deleted because User not found
944 Patrons records handled.
No comments:
Post a Comment