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

[EP-tech] Re: EPrints and RSS feeds



Thanks John. I think we'll look at building a Plugin with a new citation style that matches the third party's feed requirements.


Cheers,


Andrew


--
Andrew Hercules
Developer
Digital Archives & Research Technologies
University of London Computer Centre
Senate House, Malet Street, London WC1E 7HU
T: +44 (0)20 7863 1342
E: andrew.hercules at ulcc.ac.uk
W: http://www.ulcc.ac.uk/

The University of London is an exempt charity in England and Wales. We are committed to achieving a 20% cut in emissions from University buildings by 2015. Please think before you print.


________________________________
From: eprints-tech-bounces at ecs.soton.ac.uk <eprints-tech-bounces at ecs.soton.ac.uk> on behalf of John Salter <J.Salter at leeds.ac.uk>
Sent: 16 November 2015 11:08
To: 'eprints-tech at ecs.soton.ac.uk'
Subject: [EP-tech] Re: EPrints and RSS feeds


Hi Andrew,



As far as I know, there isn?t a way to explicitly declare a citation style to be used for the exportview.

>From Export/RSS.pm



        $item->appendChild( $session->render_data_element(

                        2,

                        "description",

                        EPrints::Utils::tree_to_utf8( $eprint->render_citation ) ) );



- this will use the ?default? citation style.



You could force this to use a new citation style that didn?t include the links (e.g. copy default.xml to rss_no_link.xml then edit it):

                        EPrints::Utils::tree_to_utf8( $eprint->render_citation( "rss_no_links" ) ) ) );



Or, looking at EPrints::Utils::tree_to_utf8:

EPrints::Utils::tree_to_utf8( $tree, $width, [$pre], [$whitespace_before], [$ignore_a] )

<a href="foo">bar</a> will be converted into "bar <foo>" unless ignore_a is set.

- inspecting the code, I?d expect that:

EPrints::Utils::tree_to_utf8( $eprint->render_citation, undef, undef, undef, 1 )

might work!?



You probably don?t want to make these changes in the ~/perl_lib/? files ? this might be of use: http://wiki.eprints.org/w/Instructions_for_local_plugins

Instructions for local plugins - Eprints Documentation
See also: Tips_to_write_plugins. To change the functionality of a core plugin within a specific archive, you can make a subclass of the original package.
Read more...<http://wiki.eprints.org/w/Instructions_for_local_plugins>





Cheers,

John





From: eprints-tech-bounces at ecs.soton.ac.uk [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Andrew Hercules
Sent: 13 November 2015 17:21
To: 'eprints-tech at ecs.soton.ac.uk'
Subject: [EP-tech] Re: EPrints and RSS feeds



Hi John,



I checked the plugins, which lead me to perl_lib/EPrints/XHTML.pm as they call on subroutines in that file.



Here's an example that I pulled from an RSS feed on Goldsmiths<http://research.gold.ac.uk/cgi/exportview/goldsmiths/Banissy=3AMichael_J=2E=3A=3A/RSS/Banissy=3AMichael_J=2E=3A=3A.rss> (within the description tag for each item):



<description> Banissy, Michael J. &lt;http://research.gold.ac.uk/view/goldsmiths/Banissy=3AMichael_J=2E=3A=3A.html&gt;; Jonas, Clare and Cohen Kadosh, Roi.  2014.  Synesthesia: an introduction.    Frontiers in Psychology, 5(1414),   pp. 1-3.  ISSN 1664-1078 [Article]     </description>



I'm trying to remove the following link, which is generated because the author has other items in the same repository:



&lt;http://research.gold.ac.uk/view/goldsmiths/Banissy=3AMichael_J=2E=3A=3A.html&gt;



I'm stumped - I've tried turning off show_links and have also changed the _to_text_dump subroutine, which transforms <a> into " <href>" within the description tag.



Cheers,



Andrew



--

Andrew Hercules

Developer

Digital Archives & Research Technologies

University of London Computer Centre

Senate House, Malet Street, London WC1E 7HU

T: +44 (0)20 7863 1342

E: andrew.hercules at ulcc.ac.uk<mailto:andrew.hercules at ulcc.ac.uk>

W: http://www.ulcc.ac.uk/



The University of London is an exempt charity in England and Wales. We are committed to achieving a 20% cut in emissions from University buildings by 2015. Please think before you print.



________________________________

From: eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk> <eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk>> on behalf of John Salter <J.Salter at leeds.ac.uk<mailto:J.Salter at leeds.ac.uk>>
Sent: 13 November 2015 17:00
To: 'eprints-tech at ecs.soton.ac.uk'
Subject: [EP-tech] Re: EPrints and RSS feeds



Hi,

Have you got an example for us to take a look at?

In the RSS feed, there are probably links you want/need (e.g in the individual <item>s).



The RSS feeds are generated as an export from

~/perl_lib/EPrints/Plugin/Export/RSS.pm

or

~/perl_lib/EPrints/Plugin/Export/RSS2.pm



- the key to what you?re trying to do may well be in one of these?



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 Andrew Hercules
Sent: 13 November 2015 16:39
To: eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>
Subject: [EP-tech] EPrints and RSS feeds



Hi everyone,



Just wondering if anybody has experience changing the way that RSS feeds display citation information. I'm trying to eliminate links as they are adding an additional space that's causing confusion with third-party sites that consume the RSS feed.



By default, in perl_lib/EPrints/XHTML.pm, show_links is enabled with show_links => 0. I tried changing the 0 to a 1 and to undef, but the link still persists. Likewise, I also tried modifying the _to_text_dump subroutine in perl_lib/EPrints/XHTML.pm by specifying that $contents .= "", but the link still shows.



Any thoughts or suggestions on where else I should look would be much appreciated as I'm still learning the ins and outs of EPrints.



Have a great weekend!



Cheers,



Andrew



--

Andrew Hercules

Developer

Digital Archives & Research Technologies

University of London Computer Centre

Senate House, Malet Street, London WC1E 7HU

T: +44 (0)20 7863 1342

E: andrew.hercules at ulcc.ac.uk<mailto:andrew.hercules at ulcc.ac.uk>

W: http://www.ulcc.ac.uk/



The University of London is an exempt charity in England and Wales. We are committed to achieving a 20% cut in emissions from University buildings by 2015. Please think before you print.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20151116/47565a2b/attachment-0001.html