EPrints Technical Mailing List Archive
Message: #02682
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
[EP-tech] Re: plugin_alias_map restrictions?
- To: eprints-tech@ecs.soton.ac.uk
- Subject: [EP-tech] Re: plugin_alias_map restrictions?
- From: Sebastien Francois <sf2@ecs.soton.ac.uk>
- Date: Fri, 28 Feb 2014 12:12:32 +0000
1- copy it to your local repository directory:cp lib/defaultcfg/citations/eprint/screen.xml archives/<id>/cfg/citations/eprint/
2- make changes (needs to be valid XHTML) 3- restart apache or reload config Seb. On 28/02/14 11:31, Andrew Beeken wrote:
Sounds like an option - how would I override the screen citation? On 28/02/2014 11:22, "Sebastien Francois" <sf2@ecs.soton.ac.uk> wrote:OK right I think I had read your post a bit too quickly Andrew, sorry! Not sure which version of EPrints you're using - on 3.3.12, Screen::EPrint::render_title is driven mostly by: my $title = $self->{processor}->{eprint}->render_citation( "screen" ); So why don't you just over-ride the "screen" citation and add the item type there? Seb. On 28/02/14 11:16, Alan.Stiles wrote:Hi Seb, So, in an attempt to understand the workings of this, trying to replace the render_title in the Screen::EPrint object by defining a local 'Screen::LocalEprint' package containing a render_title method doesn't work, because the Edit screen is essentially already defined as a child of the original EPrint definition before the alias mapping takes effect? So you need to replace/create the method in the specific class that is being instantiated? (I've probably just mashed up some OO terminology quite badly there!) Alan -----Original Message----- From: Sebastien Francois [mailto:sf2@ecs.soton.ac.uk] Sent: 28 February 2014 10:56 To: eprints-tech@ecs.soton.ac.uk Subject: [EP-tech] Re: plugin_alias_map restrictions? Should look something like: e.g. in archives/<id>/cfg/plugins/EPrints/Plugin/Screen/EPrint/LocalEdit.pm #code-start package EPrints::Plugin::Screen::EPrint::LocalEdit; @ISA = ( 'EPrints::Plugin::Screen::EPrint::Edit' ); use strict; sub render_title { # whatever you need to do } 1; #code-end in the conf (e.g. archives/<id>/cfg/cfg.d/plugins.pl): $c->{plugin_alias_map}->{"Screen::EPrint::Edit"} = "Screen::EPrint::LocalEdit"; $c->{plugin_alias_map}->{"Screen::EPrint::LocalEdit"} = undef; Then when EPrints calls Screen::EPrint::Edit, it will call your LocalEdit plug-in instead, in a transparent manner. Seb. On 28/02/14 10:47, Andrew Beeken wrote:Hello! I¹ve been working with archive localised plugins but have come up against one that¹s giving me grief. I¹m trying to extend Screen::EPrint with the intent of overriding the render_title function, adding the Eprint type to the output. I¹ve gone through the motions of creating a new child plugin with all the correct dependencies, adding the alias map line into plugins.pl, however EPrints does not seem to be inheriting this plugin at all. Are there limitations on what can be changed this way? Andrew
- References:
- [EP-tech] plugin_alias_map restrictions?
- From: Andrew Beeken <anbeeken@lincoln.ac.uk>
- [EP-tech] Re: plugin_alias_map restrictions?
- From: Sebastien Francois <sf2@ecs.soton.ac.uk>
- [EP-tech] Re: plugin_alias_map restrictions?
- From: "Alan.Stiles" <Alan.Stiles@open.ac.uk>
- [EP-tech] Re: plugin_alias_map restrictions?
- From: Sebastien Francois <sf2@ecs.soton.ac.uk>
- [EP-tech] Re: plugin_alias_map restrictions?
- From: Andrew Beeken <anbeeken@lincoln.ac.uk>
- [EP-tech] plugin_alias_map restrictions?
- Prev by Date: [EP-tech] Re: plugin_alias_map restrictions?
- Next by Date: [EP-tech] Re: CentOS 5 installation?
- Previous by thread: [EP-tech] Re: plugin_alias_map restrictions?
- Next by thread: [EP-tech] saved_search: depending on cronjob time?
- Index(es):