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

[EP-tech] RSS Feed Max. items



Here is what I ended up doing after a hint from Jiadi (thank you!)


1)      Raised the "max" in latest_tool_modes as mentioned before

2)      Added the following to plugins.pl:

In plugins.pl:
#Feeds exporters have a method "is_feed" returning true to be excluded from the export list. Override here:
package EPrints::Plugin::Export::RSS2;
sub is_feed{return 0;}
package EPrints::Plugin::Export::RSS;
sub is_feed{return 0;}
package EPrints::Plugin::Export::Atom;
sub is_feed{return 0;}

That change in the plugins.pl moved the RSS, RSS2 and Atom into the export drop-down on the search results, allowing users to Export their full search results using RSS (with no limit as to item count).  This is what I needed.

My understanding is that this is independent from the "latest_tool_modes" max, which is relevant for what those orange RSS buttons on the homepage, for example.

I hope I understood that correctly? Let's try to update the documentation on this important topic (http://wiki.eprints.org/w/Customizing_RSS_Output)

Best wishes,
Tomasz



From: eprints-tech-bounces at ecs.soton.ac.uk [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Tomasz Neugebauer
Sent: February-23-16 7:05 AM
To: eprints-tech at ecs.soton.ac.uk
Subject: Re: [EP-tech] RSS Feed Max. items


I agree, these are separate concepts that should have their own settings. Exporting 100+ search results with RSS should be possible without changing the latest items feed.

Tomasz


---- Alan.Stiles wrote ----
The 2 things do seem quite separate concepts - you may well want 50-100 items in an RSS feed, but only 10 or so in your latest items (depending on frequency of deposit!)

A separate value seems sensible to me.

Alan

From: eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk> [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of John Salter
Sent: 23 February 2016 10:14
To: 'eprints-tech at ecs.soton.ac.uk' <eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>>
Subject: Re: [EP-tech] RSS Feed Max. items

Excellent :o)

What are people's thoughts on reusing the latest_tools setting for the export?
To me this seems a bit clunky - altering this value now means people using the feeds will get 100 results too...

Would having an 'export_items_max' config value be more sensible?

Cheers,
John


From: eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk> [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Tomasz Neugebauer
Sent: 22 February 2016 20:09
To: eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>
Subject: Re: [EP-tech] RSS Feed Max. items

Hi John,

Thank you for the quick and efficient answer.

I confirm that adding the following to latest_tool.pl worked:

$c->{latest_tool_modes} = {
                default => { citation => "result", max => 100 }
};


Best wishes,
Tomasz


From: eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk> [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of John Salter
Sent: February-19-16 1:24 PM
To: 'eprints-tech at ecs.soton.ac.uk' <eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>>
Subject: [EP-tech] Re: RSS Feed Max. items

Hi,
A bit of code inspection leads me to this...
https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/Plugin/Screen/Search.pm#L516-L536
- which refers to
# borrow the max from latest_tool (which we're replicating anyway)
my $limit = $self->{session}->config(
  "latest_tool_modes", "default", "max"
);

- the latest_tool_modes is defined in ~/archives/ARCHIVEID/cfg/cfg.d/latest_tool.pl (copied from https://github.com/eprints/eprints/blob/3.3/lib/defaultcfg/cfg.d/latest_tool.pl), but currently it doesn't contain a max value - so the fallback value of 20 in Screen::Search is used.

Does this look like it's the right thing?
Adding a max to latest_tool.pl might work e.g.:
$c->{latest_tool_modes} = {
                default => { citation => "result", max => 100 }
};

If that does work, let me know and I'll add some documentation in latest_tool.pl.

Cheers,
John

From: eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk> [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Tomasz Neugebauer
Sent: 19 February 2016 17:13
To: eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>
Subject: [EP-tech] Re: RSS Feed Max. items

Does anyone know how to set the maximum number of items that are shown in the RSS export in EPrints?
I searched and found this thread from 2009 with the $self->{number_to_show} parameter described, but that doesn't seem to be working for me.
Thanks!

Tomasz


From: eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk> [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of David Kane
Sent: October-02-09 4:53 AM
To: eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>
Subject: [EP-tech] Re: RSS Feed Max. items

Hi John,

You were right.  Changing the RSS.pm solved the problem.

Thanks,

David.
2009/10/1 John Salter <J.Salter at leeds.ac.uk<mailto:J.Salter at leeds.ac.uk>>
Good question...
There's a 'max' value in [ep3]/cgi/latest_tool - that's set to 20 - and ignored.
There's another 'max' that can be set in cfg.d/search.pl for a view - but this is commented out in our archive.

EPrints/Plugin/Export/RSS.pm: $self->{number_to_show} = 10;
EPrints/Plugin/Export/Atom.pm:        $self->{number_to_show} = 10;
EPrints/Plugin/Export/RSS2.pm:        $self->{number_to_show} = 10;
-possibly the key? ;o)

Cheers,
John


________________________________
From: eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk> [mailto:eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk>] On Behalf Of David Kane
Sent: 01 October 2009 15:14
To: EPrints.org Technical List
Subject: [EP-tech] RSS Feed Max. items
Hi,

The RSS feed is set to 10 items in EPrints3,

Can anyone tell me where is that number set?

Many Thanks,

David.

--
David Kane
Systems Librarian
Waterford Institute of Technology
Ireland
http://library.wit.ie/
T: ++353.51302838
M: ++353.876693212

*** 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/



--
David Kane
Systems Librarian
Waterford Institute of Technology
Ireland
http://library.wit.ie/
T: ++353.51302838
M: ++353.876693212
-- The Open University is incorporated by Royal Charter (RC 000391), an exempt charity in England & Wales and a charity registered in Scotland (SC 038302). The Open University is authorised and regulated by the Financial Conduct Authority.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20160223/83393018/attachment-0001.html