EPrints Technical Mailing List Archive
See the EPrints wiki for instructions on how to join this mailing list and related information.
Message: #00347
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
[EP-tech] Re: Altering DajaObj/Eprint.pm behaviour without altering core code
- To: eprints-tech@ecs.soton.ac.uk
- Subject: [EP-tech] Re: Altering DajaObj/Eprint.pm behaviour without altering core code
- From: Ian Stuart <Ian.Stuart@ed.ac.uk>
- Date: Wed, 04 Apr 2012 15:37:47 +0100
Then again, why not ~/archives/[ID]/cfg/cfg.d/... ? On 04/04/12 15:40, Sebastien Francois wrote:
Good! Yes I'd add a file in cfg.d/ as you suggested. However be aware that other repositories set up there (ie. archives/[id1], archives/[id2]...) will inherit the change! Seb. On 04/04/12 15:33, John Salter wrote:Thanks Seb, works like a dream! Do you have any 'good practice' advice on how to do this within an archive? I already have ~/archives/[ID]/cfg/plugins/... for over-riding plugins. Would your advice be to add something within there, or to add something like cfg.d/core_overrides.pl? Cheers, John -----Original Message----- From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Sebastien Francois Sent: 04 April 2012 12:29 To: eprints-tech@ecs.soton.ac.uk Subject: [EP-tech] Re: Altering DajaObj/Eprint.pm behaviour without altering core code What about: *EPrints::DataObj::EPrint::render_fileinfo = \&my_render_fileinfo; sub my_render_fileinfo { # your code ... } Seb. On 04/04/12 12:18, John Salter wrote:I'm trying to do something the 'right way'*. This advice: http://wiki.eprints.org/w/Read_Only_Directories says I shouldn't be editing anything under eprints3/perl_lib/ (with a couple of exceptions). I need to alter the 'render_fileinfo' subroutine in ~/perl_lib/EPrints/DataObj/EPrint.pm. How do I achieve this without: - altering the Eprint.pm file - ending up with some 'Subroutine render_fileinfo redefined' messages - using "no warnings 'redefine';" ;o) I've tried various attempts - without success. I'm sure it can be done, and I'm sure it's a bit of perl magic I'm missing, and hopefully someone here can help! Cheers, John
-- Ian Stuart. Developer: Open Access Repository Junction and OpenDepot.org Bibliographics and Multimedia Service Delivery team, EDINA, The University of Edinburgh. http://edina.ac.uk/ This email was sent via the University of Edinburgh. The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
- References:
- [EP-tech] Altering DajaObj/Eprint.pm behaviour without altering core code
- From: John Salter <J.Salter@leeds.ac.uk>
- [EP-tech] Re: Altering DajaObj/Eprint.pm behaviour without altering core code
- From: Sebastien Francois <sf2@ecs.soton.ac.uk>
- [EP-tech] Re: Altering DajaObj/Eprint.pm behaviour without altering core code
- From: John Salter <J.Salter@leeds.ac.uk>
- [EP-tech] Re: Altering DajaObj/Eprint.pm behaviour without altering core code
- From: Sebastien Francois <sf2@ecs.soton.ac.uk>
- [EP-tech] Altering DajaObj/Eprint.pm behaviour without altering core code
- Prev by Date: [EP-tech] Re: Altering DajaObj/Eprint.pm behaviour without altering core code
- Next by Date: [EP-tech] Re: Altering DajaObj/Eprint.pm behaviour without altering core code
- Previous by thread: [EP-tech] Re: Altering DajaObj/Eprint.pm behaviour without altering core code
- Next by thread: [EP-tech] Re: Altering DajaObj/Eprint.pm behaviour without altering core code
- Index(es):