Dan Scott [Tue, 7 Apr 2020 20:02:10 +0000 (16:02 -0400)]
Allow date option to be unspecified, fix 245$h handling
We had always been adding the last two characters of 245$h, even if they
were just "].", which messes up some records. Let's only add them if
they are " /".
Dan Scott [Fri, 30 Aug 2019 16:29:59 +0000 (12:29 -0400)]
More robust patron-load interface
Feels bad to be hard-coding the path in the template, but something in
the reverse proxy broke, so let's just ensure that we're complying with
expectations. Not a bad thing to add in an isnumeric() check for
example.
Dan Scott [Tue, 24 Apr 2018 16:36:56 +0000 (12:36 -0400)]
Support Python 3
Switch to requests and beautifulsoup4 modules, use the
interoperable print() function, adjust to the updated
exceptions approach, and use dict.items() instead of
the (gone) dict.iteritems().
Dan Scott [Tue, 29 Aug 2017 17:12:15 +0000 (13:12 -0400)]
Hack to support Oxford DOIs in 956 fields
ScholarsPortal MARC records put Oxford DOIs in their 956 fields instead
of 856; let's use both of them and hope that no other records use a 956
that doesn't actually resolve.
Also, if the URL is for books.scholarsportal.info, identify
ScholarsPortal as the platform.
Dan Scott [Tue, 17 Jan 2017 14:33:48 +0000 (09:33 -0500)]
Prefer primary affiliation over student level
When figuring out the intended profile for a given account, let primary
affiliation win; we have accounts that started as students and are now back as
faculty, and the lulStudentLevel still identifies them as undergrads. That
ain't right!
Dan Scott [Thu, 27 Oct 2016 15:19:27 +0000 (11:19 -0400)]
Add visitor profile parsing
We have a strange category of students who come here for the summer but are not
officially LU students, so treat them as visitors. More work may need to be
done to distinguish them from guests.
Dan Scott [Thu, 27 Oct 2016 15:16:40 +0000 (11:16 -0400)]
Skip NO_COLLEAGUE_ID situation
Rather than literally using "NO_COLLEAGUE_ID" as the colleague ID, refuse to
create or update the corresponding record. Any LDAP records created through the
normal process should have colleague IDs, even for visitors/guests.
Dan Scott [Tue, 20 Nov 2012 18:55:02 +0000 (13:55 -0500)]
EResource handling improvements
* Add the ability to read (via -F xml) and write (via -T xml) MARCXML
records. Writing XML records will place one per line, making it
ideal for inserting into a database via COPY().
* Make the "Mark ISBN for SFX" functionality optional via the -I flag,
as not all electronic resources have ISBNs. (Hi, journals and music
records).
* Reduce code duplication significantly
Dan Scott [Thu, 25 Oct 2012 14:56:54 +0000 (10:56 -0400)]
Insert fields in order in ebook processing
pymarc 2.8.5 offers the add_ordered_field() method for inserting fields
in the correct numerical order in the record - so use that. Note that
you may have to run "easy_install --upgrade pymarc" to get the latest
version of pymarc installed.
Dan Scott [Mon, 12 Nov 2012 17:58:42 +0000 (12:58 -0500)]
Delete ILL copies as well as ILL call numbers
Evergreen 2.3 likes to show available copies in the holdings maintenance
window even if the parent call numbers are deleted. So, do what we
should have done before and delete the copies too.
Guard against deleting copies that have been renewed rather than having
their due dates extended.
Dan Scott [Thu, 4 Oct 2012 22:17:12 +0000 (18:17 -0400)]
Ebooks: Only output one record, no matter how many dupes
If you specify dupe-checking by TCN, URL, and ISBN, you only want to
generate one output record per input record, no matter how many types of
matches you get - so short-circuit the logic.
Also, handle the case where you're not specifying all dupe checks :)
Dan Scott [Thu, 4 Oct 2012 21:17:04 +0000 (17:17 -0400)]
Ebooks: handle multiple dupe options
process_fields() modifies the base record, and we were inadvertently
running the base record through the ringer every time we checked for
dupes - which would be evidenced by the addition of one 506 and 590 per
consortial member per dupe check we ran.
In the process of cleaning this up, try to dedupe some of our own code
(heh). We can probably go futher but this is a good start.
Dan Scott [Wed, 11 Jul 2012 01:20:41 +0000 (21:20 -0400)]
Use synchronous methods and cleaner results
Rather than calling ldap.result(), which results in awkward lists of
lists which are hard to handle, just iterate over the results from
ldap.search_s() (which, btw, is now a synchronous call).
Dan Scott [Tue, 10 Jul 2012 20:48:21 +0000 (16:48 -0400)]
Revert debug code that showed all LDAP attributes
Not that I mind verbosity, but unless you request the custom attributes
specifically, you only get the default LDAP attributes. And I'm more
interested in the custom ones.
Dan Scott [Tue, 10 Jul 2012 20:25:42 +0000 (16:25 -0400)]
Experimental web.py frontend for creating Conifer accounts
Use web.py to surface a simple Web UI for generating Conifer accounts
based on the Laurentian ID of a given user. Required a little
refactoring of ldap_osrf_sync to make it usable as a module rather than
just as a script, but that's all for the better.
Dan Scott [Fri, 9 Mar 2012 20:35:36 +0000 (15:35 -0500)]
Carry over the leader from the original record
We iterate over every field of the original record to create the new
record. Except... the leader is not an iterable field. So we were
pushing default leaders onto every new record we were creating. That
is... suboptimal to the max.
Dan Scott [Tue, 24 Jan 2012 21:32:31 +0000 (16:32 -0500)]
Generate email addresses where none are in LDAP
Per discussion with MLaferriere, we should expect to see LDAP entries
without a 'mail' attribute, and should build email addresses based on
the CN. For additional flourish, append @laurentian.ca or
@laurentienne.ca based on the language preference.
Dan Scott [Mon, 16 Jan 2012 22:53:27 +0000 (17:53 -0500)]
LDAP sync: If EG user found, reactivate
In theory, we won't be asked to create a user that already exists in
Evergreen if they are already there and active. So, go ahead and set the
"active" flag to true and update the account expiry date when we are
asked to create an existing user.
Dan Scott [Tue, 10 Jan 2012 18:25:38 +0000 (13:25 -0500)]
Add located URI update script (PGSQL function)
Given MARCXML, modifies the 856 $9 subfields to map to owning systems
rather than individual branches to address the located URI visibility
change in 2.1.
Dan Scott [Fri, 7 Oct 2011 17:21:55 +0000 (13:21 -0400)]
Handle "thornloe" profile
Apparently our LDAP system or a system upon which it depends is either
enforcing an 8-char limit for some reason, or we have to deal with
typos. Whatever.
Dan Scott [Wed, 14 Sep 2011 20:47:38 +0000 (16:47 -0400)]
Don't update the barcode if user was not created
Check the return value and bail if the user creation was a failure.
For large updates, one can use --create and --push to update barcodes
for users who already exist.
Dan Scott [Wed, 14 Sep 2011 20:02:14 +0000 (16:02 -0400)]
Add and use a patron search that overrides opt-in invisibility
Something like this is required for API calls that need to operate
against a number of libraries in a given instance that are using opt-in;
otherwise, attempts to search for users will fail and you may end up
creating near-duplicates etc.
The implementation adds an
open-ils.actor.search.patron.advanced.opt_in_override method to
open-ils.actor, which, if invoked, checks to see if the caller has the
OPT_IN_OVERRIDE permission. If so, then the crazy_search ignores the
normal opt-in limits and searches all pertinent users in the database.
As a global permission, OPT_IN_OVERRIDE is a blunt instrument. Others
might want to put together a more refined version that uses OU depths to
define boundaries.
Signed-off-by: Dan Scott <dscott@laurentian.ca>
Conflicts:
Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/actor.pm
Dan Scott [Wed, 14 Sep 2011 19:00:18 +0000 (15:00 -0400)]
More defensive error handling
When users aren't opted-in, we can't search for them. Fiddlesticks! This
was breaking the script rather annoyingly; now we print out an error and
move on to the next user.
Dan Scott [Fri, 9 Sep 2011 04:45:30 +0000 (00:45 -0400)]
New --push-barcode option updates LDAP with Evergreen barcodes
By default, the --create-users option will update LDAP with the new
barcode that was generated for the new users.
One can also use a --query of some type and pass --push-barcode to
retrieve the barcodes for all of the LDAP users from Evergreen and then
push those barcodes into their respective LDAP accounts.
Dan Scott [Tue, 7 May 2013 18:48:51 +0000 (14:48 -0400)]
Generate barcodes and push them into LDAP
Call the new custom API to open-ils.actor for generating barcodes;
accepts one argument, user ID, which gets the barcode set to their new
value. If no arg is passed, just generates a new barcode and returns it
(should be useful on the patron editor screen).
As far as pushing the barcodes into LDAP goes, I can't confirm that the
updates are actually working, because I can't see them, but the lack of
errors suggests that it's working.