]> git.evergreen-ils.org Git - contrib/Conifer.git/log
contrib/Conifer.git
7 years agoPrefer primary affiliation over student level feature/tools_2_4
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!

Signed-off-by: Dan Scott <dscott@laurentian.ca>
7 years agoUpdate profile mappings for faculty and grads
Dan Scott [Thu, 12 Jan 2017 21:22:11 +0000 (16:22 -0500)]
Update profile mappings for faculty and grads

Signed-off-by: Dan Scott <dscott@laurentian.ca>
7 years agoAdd visitor profile parsing
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.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
7 years agoSkip NO_COLLEAGUE_ID situation
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.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
7 years agoMake loginExpirationTime attribute great again
Dan Scott [Thu, 27 Oct 2016 15:15:50 +0000 (11:15 -0400)]
Make loginExpirationTime attribute great again

If the LDAP record has this attribute, it should trump everything.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
7 years agoSupport query parm of "creation end time"
Dan Scott [Thu, 27 Oct 2016 15:12:13 +0000 (11:12 -0400)]
Support query parm of "creation end time"

Having both a start and end time enables staging of
updates over swathes of users by time.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
8 years agoAdd platform identifier to the 856 link text
Dan Scott [Tue, 15 Mar 2016 13:07:23 +0000 (09:07 -0400)]
Add platform identifier to the 856 link text

We want "Available online / Disponible en ligne (<platform>) so let's do
that.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
8 years agoRemove Windsor options from book script
Dan Scott [Mon, 14 Mar 2016 16:54:57 +0000 (12:54 -0400)]
Remove Windsor options from book script

Signed-off-by: Dan Scott <dscott@laurentian.ca>
8 years agoColleague IDs are now alphanumeric
Dan Scott [Fri, 19 Feb 2016 22:03:56 +0000 (17:03 -0500)]
Colleague IDs are now alphanumeric

Signed-off-by: Dan Scott <dscott@laurentian.ca>
8 years agoGuest affiliates map to Reader accounts
Dan Scott [Fri, 19 Feb 2016 22:03:04 +0000 (17:03 -0500)]
Guest affiliates map to Reader accounts

Signed-off-by: Dan Scott <dscott@laurentian.ca>
8 years agoWhen updating a user, do not reset their password
Dan Scott [Mon, 25 Jan 2016 17:33:51 +0000 (12:33 -0500)]
When updating a user, do not reset their password

Also, avoid a logic issue where if we have the barcode in hand it
prevented us from syncing the user's attributes.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
8 years agoRepopulate bookbags based on ACQ funds
Dan Scott [Thu, 15 Oct 2015 20:15:44 +0000 (16:15 -0400)]
Repopulate bookbags based on ACQ funds

Now that we're using acquisitions, commit ourselves to an approach that
populates our existing bookbags using the fund codes.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
8 years agoMake the web form reflect the patron load/update
Dan Scott [Thu, 8 Oct 2015 15:53:38 +0000 (11:53 -0400)]
Make the web form reflect the patron load/update

Now that we sync the LDAP attributes directly through the web form, tell
the user that.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
8 years agoImprove debug output
Dan Scott [Wed, 7 Oct 2015 21:17:59 +0000 (17:17 -0400)]
Improve debug output

For some exceptions, we don't get a message object with an info key, so
be more tolerant.

Also, dump the DN when we dump the general data.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
8 years agoAlumni (from DN) trumps all else
Dan Scott [Wed, 7 Oct 2015 21:17:15 +0000 (17:17 -0400)]
Alumni (from DN) trumps all else

We need to reflect Alumni status, which comes only from the DN, rather
than from the primary affiliation, etc, so trump everything else with
that.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
8 years agoUse the lower-case version of the CN
Dan Scott [Mon, 28 Sep 2015 19:43:17 +0000 (15:43 -0400)]
Use the lower-case version of the CN

Because CamelCase names don't work well when people are logging in with
lower case names.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
8 years agoFix an "always OSUL" thinko
Dan Scott [Mon, 28 Sep 2015 19:41:54 +0000 (15:41 -0400)]
Fix an "always OSUL" thinko

A conditional that always returns true but looks conditional is a little
nasty!

Signed-off-by: Dan Scott <dscott@laurentian.ca>
8 years agoDo not create accounts for applicants
Dan Scott [Fri, 17 Jul 2015 15:14:15 +0000 (11:14 -0400)]
Do not create accounts for applicants

Signed-off-by: Dan Scott <dscott@laurentian.ca>
8 years agoDo a better job of tolerating missing credentials.py
Dan Scott [Wed, 31 Jul 2013 19:32:35 +0000 (15:32 -0400)]
Do a better job of tolerating missing credentials.py

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoAdjust ldap_osrf_sync for generic BC generation
Dan Scott [Thu, 10 Jan 2013 22:10:44 +0000 (17:10 -0500)]
Adjust ldap_osrf_sync for generic BC generation

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoEResource handling improvements
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

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoInsert fields in order in ebook processing
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.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoDelete ILL copies as well as ILL call numbers
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.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoEbooks: Only output one record, no matter how many dupes
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 :)

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoEbooks: Laurentian's wildcard cert expired, use plain HTTP
Dan Scott [Thu, 4 Oct 2012 21:54:58 +0000 (17:54 -0400)]
Ebooks: Laurentian's wildcard cert expired, use plain HTTP

Rather than frightening people with expired certificate warnings in
their browser, just send them to HTTP. Sigh.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoEbooks: handle multiple dupe options
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.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoEbooks: add an option to clean diacritics
Dan Scott [Thu, 4 Oct 2012 21:16:15 +0000 (17:16 -0400)]
Ebooks: add an option to clean diacritics

Some sets of records seem to come with cleaner diacritics than others.
Huzzah for an increasingly UTF8 world?

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoEbook processing - more pythonic string coercion
Dan Scott [Thu, 4 Oct 2012 19:08:02 +0000 (15:08 -0400)]
Ebook processing - more pythonic string coercion

Avoid the regurgitation of errors due to trying to add a string to an
integer

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoEbooks script code cleanup
Dan Scott [Thu, 4 Oct 2012 18:45:56 +0000 (14:45 -0400)]
Ebooks script code cleanup

Lots of accumulated whitespace / line length code convention issues.
This makes pylint happier (from 8.65 to 9.44).

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoAdding 2 options to prep_ebook_records.py script
Art Rhyno [Thu, 4 Oct 2012 18:32:46 +0000 (14:32 -0400)]
Adding 2 options to prep_ebook_records.py script

This supports 2 additional options to Dan Scott's ebook script:

    -t / --tcn : The name of the file to route TCN duplicates to.

The tcn search takes the 001 and does an OpenSRF open-ils.search.biblio.tcn
call.

   -u / --url : The name of the file to route URL duplicates to.

The url search is based on the 856u field and is done with the OpenSRF
open-ils.search.biblio.multiclass.query call.

Signed-off-by: Art Rhyno <art632000@yahoo.ca>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoAdd a gale code for the Gale electronic resources
Dan Scott [Thu, 4 Oct 2012 18:17:07 +0000 (14:17 -0400)]
Add a gale code for the Gale electronic resources

Every electronic resource provider has to be different, eh? Sheesh.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoAdd Leddy to the list of libraries for circ_date_to_expire
Dan Scott [Thu, 23 Aug 2012 14:56:41 +0000 (10:56 -0400)]
Add Leddy to the list of libraries for circ_date_to_expire

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoLDAP: Create and push barcodes from Web UI
Dan Scott [Mon, 16 Jul 2012 16:24:44 +0000 (12:24 -0400)]
LDAP: Create and push barcodes from Web UI

Now that we're beyond basic testing, go ahead and create accounts or
push barcodes into LDAP for realz.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoEnsure we only generate unique barcodes
Dan Scott [Fri, 13 Jul 2012 15:20:15 +0000 (11:20 -0400)]
Ensure we only generate unique barcodes

Rather than looping over existing barcodes only when we update the
patron account, let's not return duplicate barcodes in the first place,
mmmkay?

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoPrep for use in mod_wsgi
Dan Scott [Wed, 11 Jul 2012 13:46:10 +0000 (09:46 -0400)]
Prep for use in mod_wsgi

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoUse synchronous methods and cleaner results
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).

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoRevert debug code that showed all LDAP attributes
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.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoExperimental web.py frontend for creating Conifer accounts
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.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoCarry over the leader from the original record
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.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoUpdate codes for new located URI scoping behaviour
Dan Scott [Fri, 24 Feb 2012 05:44:19 +0000 (00:44 -0500)]
Update codes for new located URI scoping behaviour

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoAvoid double-proxying boreal links
Dan Scott [Thu, 23 Feb 2012 21:48:11 +0000 (16:48 -0500)]
Avoid double-proxying boreal links

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoAddress encoding errors due to 1st UTF8 usage in options
Dan Scott [Thu, 23 Feb 2012 21:47:08 +0000 (16:47 -0500)]
Address encoding errors due to 1st UTF8 usage in options

We have to tell Python that our strings are UTF-8, naturally.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoAdd Boreal to the ebook handling script
Dan Scott [Thu, 23 Feb 2012 20:18:52 +0000 (15:18 -0500)]
Add Boreal to the ebook handling script

Also simplify some code paths through the power of Python list
comprehensions and dictionaries, instead of repetitive code.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoFully-qualified CN is not a good basis for email addresses
Dan Scott [Thu, 2 Feb 2012 20:09:00 +0000 (15:09 -0500)]
Fully-qualified CN is not a good basis for email addresses

Not unless you really like cn=Foo,ou=Bar@foobar.ca as an email address,
anyway.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoGenerate email addresses where none are in LDAP
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.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoLDAP sync: If EG user found, reactivate
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.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoMore robust identity value handling for LDAP tooling
Dan Scott [Tue, 10 Jan 2012 19:00:16 +0000 (14:00 -0500)]
More robust identity value handling for LDAP tooling

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoAdjust to new values of permission groups in 2.1
Dan Scott [Tue, 10 Jan 2012 18:47:06 +0000 (13:47 -0500)]
Adjust to new values of permission groups in 2.1

We shifted the permission group IDs when we upgraded to 2.1 and have to
compensate accordingly in this hard-coded script.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoAdd located URI update script (PGSQL function)
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.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoLDAP: More robust processing and error reporting
Dan Scott [Mon, 5 Dec 2011 16:44:30 +0000 (11:44 -0500)]
LDAP: More robust processing and error reporting

Don't die if we don't have an lulColleagueId; spit out the attributes
that we have ready at hand to help identify the problem record.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoDon't srip our own 924 field from the record
Dan Scott [Sat, 12 Nov 2011 05:18:51 +0000 (00:18 -0500)]
Don't srip our own 924 field from the record

Also, a lot of other changes to make the ebrary option actually work.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoEbrary CEL: Work towards ebook requirements
Dan Scott [Sat, 12 Nov 2011 01:59:00 +0000 (20:59 -0500)]
Ebrary CEL: Work towards ebook requirements

Of most importance, copy the incoming 001 value identifying the Ebrary
record into the 924 for use in SFX lookups.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoAdd Boreal preferences for ebooks
Dan Scott [Thu, 10 Nov 2011 19:50:42 +0000 (14:50 -0500)]
Add Boreal preferences for ebooks

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoHandle "thornloe" profile
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.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoLDAP patron load: map "thornloe" to staff
Dan Scott [Fri, 7 Oct 2011 17:19:43 +0000 (13:19 -0400)]
LDAP patron load: map "thornloe" to staff

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoLDAP patron load: handle more errors more gracefully
Dan Scott [Fri, 7 Oct 2011 17:16:09 +0000 (13:16 -0400)]
LDAP patron load: handle more errors more gracefully

It's possible for users in LDAP to not have email; instead of absolutely
dying, just warn and move on to the next user.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoDon't update the barcode if user was not created
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.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoUse the new opt_in_override method to search for users
Dan Scott [Wed, 14 Sep 2011 20:03:08 +0000 (16:03 -0400)]
Use the new opt_in_override method to search for users

Now that we have the opt_in_override method, use it to find users who
might exist in any OU in the consortium, rather than just the
workstation OU.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoAdd and use a patron search that overrides opt-in invisibility
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

10 years agoMore defensive error handling
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.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoCorrect a dangling reference to a raw variable
Dan Scott [Wed, 14 Sep 2011 16:33:10 +0000 (12:33 -0400)]
Correct a dangling reference to a raw variable

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoPass User objects rather than raw vars
Dan Scott [Wed, 14 Sep 2011 15:56:09 +0000 (11:56 -0400)]
Pass User objects rather than raw vars

Also strip out functions that are not used in this script relating to
the creation of barcodes.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoHandle new 'Proxy' lulAffiliation a bit more gracefully
Dan Scott [Mon, 12 Sep 2011 21:27:46 +0000 (17:27 -0400)]
Handle new 'Proxy' lulAffiliation a bit more gracefully

In general, if we don't have an explicit profile, just return.

Signed-off-by: Dan Scott <dan@coffeecode.net>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoNew --push-barcode option updates LDAP with Evergreen barcodes
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.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoGenerate barcodes and push them into LDAP
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.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoCommand line options for queries and actions
Dan Scott [Thu, 8 Sep 2011 15:35:31 +0000 (11:35 -0400)]
Command line options for queries and actions

Use the argparse module to enable override of user/password/hostname
options at the command line, as well as to enable different types of
queries (for example, via LDAP cn / sn / id / createTimestamp) and
enable particular actions (display the LDAP data and/or create new users
in Evergreen).

Much better than manually editing the script each time.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoGetting LDAP synchronization production ready
Dan Scott [Wed, 7 Sep 2011 15:34:04 +0000 (11:34 -0400)]
Getting LDAP synchronization production ready

* Search for user before attempting to create the user
* Set the default expiry date by profile
* Document how we're currently populating barcodes

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoGet working OpenSRF integration, genericize a bit
Dan Scott [Wed, 7 Sep 2011 07:12:56 +0000 (03:12 -0400)]
Get working OpenSRF integration, genericize a bit

Still need to teach the beast how to provision barcodes, then write
those back to LDAP as well. Pushing the LDAP mapping into the User class
init method seems like a reasonable way to genericize this a bit; sites
could replace the User class implementation.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoTowards a periodic OpenSRF-speaking LDAP patron sync script
Dan Scott [Tue, 6 Sep 2011 20:16:51 +0000 (16:16 -0400)]
Towards a periodic OpenSRF-speaking LDAP patron sync script

Still need to factor out the mapping of LDAP schema to Evergreen
attributes further but patience, patience.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoWhat we _actually_ ran for the first load of student data
Dan Scott [Fri, 2 Sep 2011 12:54:19 +0000 (08:54 -0400)]
What we _actually_ ran for the first load of student data

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoAdd lulStudentLevel filter for students
Dan Scott [Fri, 2 Sep 2011 01:34:54 +0000 (21:34 -0400)]
Add lulStudentLevel filter for students

Prefer lulStudentLevel to distinguish between undergrad and grad
students.

Left-pad, with zeroes, Colleague IDs that are shorter than 7 digits.

Don't update names from LDAP as they appear to lack Unicode support.

Sundry small pylint fixes.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoIt's nice when a script actually runs
Dan Scott [Thu, 1 Sep 2011 18:06:04 +0000 (14:06 -0400)]
It's nice when a script actually runs

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoAvoid generating barcodes that are already in the database
Dan Scott [Thu, 1 Sep 2011 18:03:54 +0000 (14:03 -0400)]
Avoid generating barcodes that are already in the database

And complain when we get a colleague ID that is not the expected size.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoPush errors to STDERR consistently
Dan Scott [Thu, 1 Sep 2011 16:58:07 +0000 (12:58 -0400)]
Push errors to STDERR consistently

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoClean up LDAP synchronization tool further
Dan Scott [Thu, 1 Sep 2011 16:51:04 +0000 (12:51 -0400)]
Clean up LDAP synchronization tool further

A few syntax errors here, a few logic errors there... that's what we
have test servers for.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoAdd email address into COPY input
Dan Scott [Thu, 1 Sep 2011 04:34:25 +0000 (00:34 -0400)]
Add email address into COPY input

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoFix filter error, improve key existence test
Dan Scott [Wed, 31 Aug 2011 20:42:39 +0000 (16:42 -0400)]
Fix filter error, improve key existence test

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoBreak barcode generator into smaller pieces
Dan Scott [Wed, 31 Aug 2011 20:08:48 +0000 (16:08 -0400)]
Break barcode generator into smaller pieces

This should make it easier to expose evergreen.lu_generate_barcode() for
manual purposes (e.g. for creating a new user on the fly in the Register
Patron UI).

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoProgress on the LDAP patron loading script
Dan Scott [Wed, 31 Aug 2011 19:54:42 +0000 (15:54 -0400)]
Progress on the LDAP patron loading script

Many functions defined and individually tested, still need to put this
together in working order.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoProgress towards reality - generating staging table inserts
Dan Scott [Wed, 31 Aug 2011 13:29:48 +0000 (09:29 -0400)]
Progress towards reality - generating staging table inserts

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoLU loaded T&F content onto ebrary, thus no CRKN T&F for them
Dan Scott [Thu, 25 Aug 2011 21:04:23 +0000 (17:04 -0400)]
LU loaded T&F content onto ebrary, thus no CRKN T&F for them

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoAdd a script for quickly checking for encoding errors
Dan Scott [Wed, 24 Aug 2011 17:00:16 +0000 (13:00 -0400)]
Add a script for quickly checking for encoding errors

Also update the ldap_sync script to be more grown-up.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoWay too little LDAP code
Dan Scott [Mon, 22 Aug 2011 20:22:33 +0000 (16:22 -0400)]
Way too little LDAP code

Signed-off-by: Dan Scott <dan@coffeecode.net>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoLaurentian _does_ have T&F - just not on ScholarsPortal for now
Dan Scott [Fri, 19 Aug 2011 18:10:46 +0000 (14:10 -0400)]
Laurentian _does_ have T&F - just not on ScholarsPortal for now

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoAutomate the CRKN processing with a little script
Dan Scott [Mon, 15 Aug 2011 17:03:24 +0000 (13:03 -0400)]
Automate the CRKN processing with a little script

Parallelized via ( &) for your convenience.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoEnsure fixed fields are correct and avoid bad public notes
Dan Scott [Fri, 12 Aug 2011 15:52:45 +0000 (11:52 -0400)]
Ensure fixed fields are correct and avoid bad public notes

One more iteration based on the UWin team's set of feedback on the
hopefully penultimate processing round for the CRKN records.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoAdd a few more T&F data uncorruption fixes
Dan Scott [Thu, 11 Aug 2011 20:45:45 +0000 (16:45 -0400)]
Add a few more T&F data uncorruption fixes

Note that we're now seeing conflicting patterns, so some
legitimate characters are getting corrupted by the script,
while others could go either way (l stroke vs modifier prime).
As long as the fix rate is 95%+ then I'm happy.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoAnd append the ' ; ' to 506 $b as well
Dan Scott [Thu, 11 Aug 2011 16:24:50 +0000 (12:24 -0400)]
And append the ' ; ' to 506 $b as well

In our refactoring, we messed up the 506 $b. Sigh.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoFor the Oxford vs. Cambridge thing, add periods
Dan Scott [Thu, 11 Aug 2011 16:02:20 +0000 (12:02 -0400)]
For the Oxford vs. Cambridge thing, add periods

We lost consistency due to the sorting out of the combined CUP & OUP
MARC records in that the hard-coded publisher names did not end with a
period.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoBe more consistent when applying the period to 710 $a
Dan Scott [Thu, 11 Aug 2011 15:38:42 +0000 (11:38 -0400)]
Be more consistent when applying the period to 710 $a

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoRefine based on feedback from Windsor
Dan Scott [Thu, 11 Aug 2011 15:25:33 +0000 (11:25 -0400)]
Refine based on feedback from Windsor

1) 506 $a and $b both need to end with ' ; '; try to make this happen
   even if the command line is screwed up.

2) Ensure the incoming 710 $a ends with a period.

Also, do not generate a 506 for Algoma if publisher == Cambridge

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoAdd more carons, based on outliers from CRKN_OUP
Dan Scott [Tue, 2 Aug 2011 20:38:03 +0000 (16:38 -0400)]
Add more carons, based on outliers from CRKN_OUP

Note that in at least one case, this would result in MUSICA becoming
MSICA. Sigh. Finally the conflicts arrive.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoCorrect I BREVE for Mr. Sakharov
Dan Scott [Tue, 2 Aug 2011 19:44:36 +0000 (15:44 -0400)]
Correct I BREVE for Mr. Sakharov

We were adding an extra i to the composed I BREVE chars.

Also log diffs so we can eyeball the changes and know that they are
good.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoReplace C with acute accent as well
Dan Scott [Fri, 29 Jul 2011 21:54:08 +0000 (17:54 -0400)]
Replace C with acute accent as well

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoMore search and replace operations
Dan Scott [Fri, 29 Jul 2011 19:49:10 +0000 (15:49 -0400)]
More search and replace operations

S cedilla, combining ligatures, modifier letter prime

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoUse composed breves, add combining dot above
Dan Scott [Fri, 29 Jul 2011 18:34:42 +0000 (14:34 -0400)]
Use composed breves, add combining dot above

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoR CARON is another good one
Dan Scott [Fri, 29 Jul 2011 18:19:30 +0000 (14:19 -0400)]
R CARON is another good one

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoS with combining acute accent (lower and uppercase)
Dan Scott [Fri, 29 Jul 2011 18:11:05 +0000 (14:11 -0400)]
S with combining acute accent (lower and uppercase)

We can use the composed codepoint for these instead of going the
decomposed route, for more accuracy and great justice.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoApply the modified letter half ring throughout
Dan Scott [Fri, 29 Jul 2011 17:54:05 +0000 (13:54 -0400)]
Apply the modified letter half ring throughout

Looks like it can be an inplace modification, so let's do it.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
10 years agoCombining breve for Mr. Sakharov
Dan Scott [Fri, 29 Jul 2011 17:50:08 +0000 (13:50 -0400)]
Combining breve for Mr. Sakharov

Signed-off-by: Dan Scott <dscott@laurentian.ca>