Hereís confirmation that overriding the holds logic works. Thanks!
From: Demian Katz [mailto:email@example.com]
Sent: Wednesday, February 27, 2013 9:42 AM
To: Chanel Wheeler; vufind-tech (firstname.lastname@example.org)
Subject: RE: [VuFind-Tech] VuFind 2 - extending class from file not in module.config.php
Okay, after some frantic refactoring this morning, Iíve got services set up for the hold logic:
You can now override the 'VuFind\ILSHoldLogic' and/or 'VuFind\ILSTitleHoldLogic' services to inject custom behavior.
Let me know if you have any questions/problemsÖ and apologies in advance if itís a bit painful merging up to the current master. There are a lot of parts in motion right now.
I only understand the options youíre offering at a high level so I canít comprehend what the full set of ramifications would be for either choice. Iíll answer in this fashion: the solution should offer the most
versatility in affecting how/when/what hold-related links appear. For example, we donít do recalls Ė patrons place holds on anything thatís holdable and wait their turn. Generally we offer title holds, but we switch to copy holds for volume-/issue- based items
(title holds and copy holds are mutually exclusive).
So does one of the options achieve maximum versatility better than the other? (If you go with option #2, I can definitely say Iím going to need some help with the infrastructure.
Right now, there's no extension point for the hold logic code. There are a couple of approaches:
1.) We could define the hold logic as a service in one of the configured plugin managers, and then have everything that uses it pull it from there; then you would be able to configure a custom hold logic class just like other things.
2.) We could add setters to classes that rely on the hold logic -- so, for example, the SolrMarc record driver could have setHoldLogic/getHoldLogic methods, with getHoldLogic constructing a default \VuFind\ILS\Logic\Holds object if no override was set. Then
using an alternative class would be a matter of creating a custom factory for the SolrMarc class that injects a different Holds logic object.
Does that make sense? I think #1 might be a bit less work for you to deal with, but it makes our huge configuration yet another notch larger. Option #2 requires less default configuration, but it makes the custom configuration a little less convenient. Let
me know if you have thoughts/preferences, and I can help create the infrastructure you need to plug in your custom class if that would be useful. (Hopefully I'll have a few minutes tomorrow).
From: Chanel Wheeler [Chanel.Wheeler@yavapai.us]
Sent: Tuesday, February 26, 2013 4:14 PM
To: vufind-tech (email@example.com)
Subject: [VuFind-Tech] VuFind 2 - extending class from file not in module.config.php
Iím extending VuFind/ILS/Logic/Holds. I donít see anything in the VuFind module.config.php that I should add/customize for my local module. The reason this is of particular concern is because VuFind isnít picking
up my local Holds.php with the extended class (I even tried putting gibberish in it and VuFind isnít barfing). Iíve deleted the cached Objects directory and restarted VuFind. What else do I need to do?
Library Network Programmer/Analyst
Yavapai Library Network
1120 Commerce Dr.
Prescott, AZ 86305
Phone: (928) 442-5741
Open a help desk ticket