[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] Re: plugin_alias_map restrictions?



Sounds like an option - how would I override the screen citation?

On 28/02/2014 11:22, "Sebastien Francois" <sf2 at 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 at ecs.soton.ac.uk]
>> Sent: 28 February 2014 10:56
>> To: eprints-tech at 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
>>>
>>> The University of Lincoln, located in the heart of the city of
>>>Lincoln, has established an international reputation based on high
>>>student satisfaction, excellent graduate employment and world-class
>>>research.
>>>
>>> The information in this e-mail and any attachments may be
>>>confidential. If you have received this email in error please notify
>>>the sender immediately and remove it from your system. Do not disclose
>>>the contents to another person or take copies.
>>>
>>> Email is not secure and may contain viruses. The University of Lincoln
>>>makes every effort to ensure email is sent without viruses, but cannot
>>>guarantee this and recommends recipients take appropriate precautions.
>>>
>>> The University may monitor email traffic data and content in
>>>accordance with its policies and English law. Further information can
>>>be found at: http://www.lincoln.ac.uk/legal.
>>>
>>> *** Options: 
>>>http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
>>> *** Archive: http://www.eprints.org/tech.php/
>>> *** EPrints community wiki: http://wiki.eprints.org/
>>> *** EPrints developers Forum: http://forum.eprints.org/
>> *** Options: 
>>http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
>> *** Archive: http://www.eprints.org/tech.php/
>> *** EPrints community wiki: http://wiki.eprints.org/
>> *** EPrints developers Forum: http://forum.eprints.org/
>> -- The Open University is incorporated by Royal Charter (RC 000391), an
>>exempt charity in England & Wales and a charity registered in Scotland
>>(SC 038302).
>>
>> *** Options: 
>>http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
>> *** Archive: http://www.eprints.org/tech.php/
>> *** EPrints community wiki: http://wiki.eprints.org/
>> *** EPrints developers Forum: http://forum.eprints.org/
>
>*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
>*** Archive: http://www.eprints.org/tech.php/
>*** EPrints community wiki: http://wiki.eprints.org/
>*** EPrints developers Forum: http://forum.eprints.org/