From: Demian K. <dem...@vi...> - 2010-11-11 16:51:35
|
Eric, Thanks for sharing your experience -- hopefully it will help others! Just a couple of comments that you might find helpful: 1.) You can actually make your EadRecord class even smaller. You don't need the constructor, since it will inherit the identical one from IndexRecord. Additionally, since your getHoldings() method is so similar to IndexRecord's, you could rewrite it like this in order to minimize redundancy: public function getHoldings() { global $interface; // added library to holdings --ELM (11/5/2010) $interface->assign('CRRALibrary', $this->fields[ 'building' ][0]); $interface->assign('CRRAInstitution', $this->fields[ 'institution' ][0]); return parent::getHoldings(); } This will add your two special fields and still do all the normal behavior of the parent class. 2.) As we discussed, the cleanest, most maintainable way of changing the behavior of the existing IndexRecord and MarcRecord classes is to create a new child class -- something like CRRAMarcRecord. That way, you have to worry less about changes to the VuFind-provided code (though obviously major refactoring always has the potential to mess up your work). The disadvantage of this is that you need to reindex everything to make the change take effect... but I think in the long term it may be worth the investment, especially if you phase it in gradually (nothing stops you from using a custom extended Marc driver at the same time as a hacked default Marc driver while your index is being updated). 3.) You mention wanting a config.ini setting to control the summAjaxStatus value in the record driver, but I'm not sure that this would be useful in a lot of situations. A global "off" switch would be nice for some use cases, but I think many real-life situations are going to be too complex for a binary switch to handle -- i.e. some MARC records loaded from a local ILS that need real-time status and others loaded from a third-party vendor that need to be handled differently. I think controlling this at the record driver level may be the best option. However, I did have one thought that might solve your problem in a different way -- it might be useful to have a special "No ILS" ILS driver that, when selected, automatically disables all ILS-related functionality in VuFind. I haven't given too much thought to the best way of implementing this... but it might be worth a JIRA ticket at least. - Demian > -----Original Message----- > From: Eric Lease Morgan [mailto:em...@nd...] > Sent: Wednesday, November 10, 2010 9:26 PM > To: vuf...@li... > Subject: [VuFind-Tech] record drivers and templates > > > I just finished writing a blog posting describing how I created/edited > VUFind record drivers and Smarty templates. [1] > > Not that none of us have previously done this, I blogged about the > process in order to help remind myself what I did as well as document > the process for anybody following me. In short, I created a new record > type called "ead". I then wrote a file called EadRecord.php which > inherits the vast majority of its functions from IndexRecord.php. > EadRecord.php only has two methods. [2] One to extract URLs from the > Solr fullrecord field, and one to add the names of libraries and > institutions to a template. In order to display call numbers I turned > off summAjaxStatus in MarcRecord.php. In IndexRecord I also extracted > the names of libraries, their hosting institutions, and the call number > from the fullrecord field. Finally, I updated holdings.tpl and > results.tpl to display the extracted data. > > Finally, I want to acknowledge Demian's help. Articulate, and > especially patient with me, a Perl programmer whose PHP skills could be > improve. "Thank you." > > [1] posting - http://bit.ly/cp4LG5 > [2] EadRecord.php - http://bit.ly/9SfbTj > > -- > Eric Lease Morgan > University of Notre Dame > > > > ----------------------------------------------------------------------- > ------- > Centralized Desktop Delivery: Dell and VMware Reference Architecture > Simplifying enterprise desktop deployment and management using > Dell EqualLogic storage and VMware View: A highly scalable, end-to-end > client virtualization framework. Read more! > http://p.sf.net/sfu/dell-eql-dev2dev > _______________________________________________ > Vufind-tech mailing list > Vuf...@li... > https://lists.sourceforge.net/lists/listinfo/vufind-tech |