Automatic Directory Updating from ODBC source...
Submitted by jenelso2 on Tue, 01/26/2016 - 14:55
Hey folks, long time no post. We've been live with our site officially since last July and I've been rather busy keeping my head above water here, so I haven't had much time to spend on the dev net.
However, I wanted to share my latest Jadu conquest - automatic directory updating from an odbc source. I haven't gotten the script to a point where it's ready to share with the world, but I do have it working in our environment. As I'm sure you're aware, one of the great features of the directories is the importing/exporting feature that allows you to wholesale update your directory data easily. This is great, works great. However, one of the issues we had difficulty with is when importing data from an authoritative source (our SAP system specifically).
We started with a fresh import of the data from SAP into our faculty/staff directory, seen here:
When we needed to make updates (employee leaves, gets hired, changes titles, etc.), it was easiest to simply overwrite everything with new authoritative data. Great, except that all the internal ID's of those directory entries are changed as the records are deleted and added, instead of being updated. So linking to those records from other pages became problematic. Another issue for us, was that the Jadu CMS was actually authoritative for some of the data (map coordinates, certain departments, etc.), so completely deleting and starting over was impractical.
I wrote script that uses all native Jadu functions and classes, but walks through the ODBC (our SAP) source and compares record by record, updating fields as needed, updating metadata when changes are made (modified time), turning records live/not live as needed, etc. I added two fields to our records, one a drop down "Source System" with options for CMS or SAP. The other field is Source System ID, for us it was an internal database ID in the SAP system.
If anyone is interested and if I ever find the time to polish the script up so it's nice and clean and commented, I'll be more than happy to share with the rest of the dev's out there.
General Concept:
Jadu Product:
Jadu Version:
