EPrints Technical Mailing List Archive

Message: #02363


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] Re: {Disarmed} Re: Re: last additions rather than latest


Aaah, I see what you mean now!

 

If you’ve got Firefox and Firebug, you should be able to see the Ajax call in the ‘console’ tab – which might help.

I think that the Ajax call might be setting an ‘output’ parameter (possibly to json or XML), so line 96 of cgi/latest_tool comes into play – which offloads the output to an Export plugin.

 

This might be a nice subtle bug in the handling of citations for the latest_tool…

 

NB This is all speculation – I haven’t tested any of these theories.

Cheers,

John

 

From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Derek Lawrie
Sent: 31 October 2013 15:17
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] Re: {Disarmed} Re: Re: last additions rather than latest

 



But that's what I'm saying John, I have this:

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


In ~archives/ARHIVEID/cfg/cfg.d/latest_tool.pl

So as you say it should be using result.xml, it isn't.

I would chase the HTML comments but I'm injecting it into the page with
AJAX currently, which doesn't show in the View Source (I know it'll show
the HTML in the "Inspect Element" debugger, but that cleans out comments)

I'm now wondering if it's because, as you stated, 'latest_tool_citation'
isn't actually defined?

Thanks
Derek


From: John Salter <J.Salter@leeds.ac.uk>
Reply-To: Eprints <eprints-tech@ecs.soton.ac.uk>
Date: Thursday, October 31, 2013 1:54 PM
To: Eprints <eprints-tech@ecs.soton.ac.uk>
Subject: [EP-tech] Re: {Disarmed} Re: Re: last additions rather than
latest


I should be using ~/archives/<id>/cfg/citations/eprint/default.xml I think.

The citations are read in from:
~/archives/ARCHIVEID/cfg/citations/…
and if it doesn’t exist in there,
~/lib/citations/…

Looking at the code for ~/cfg/latest_tool, it checks for

my $citation = $session->config( "latest_tool_citation" );
- but ‘latest_tool_citation’ isn’t actually defined anywhere in the
defaultcfg (commented out or not), which I guess (haven’t traced it
through the code) means
it will use ‘default’.


If you wanted *all* latest_tool citations (except modes where it’s
explicitly defined) to use e.g. result.xml, you could define

$c-{ latest_tool_citation} = ‘result’;
somewhere in a cfg.d/ file (latest_tool.pl perhaps).

Does that get you further down the line?
If you look at the source of the html output from latest_tool, you should
be able to see the comments that are included inside the <cite:citation>
node. On
a dev server you might want to add e.g. <!-- from:
citations/eprint/result.xml --> to help you work out what comes from where.

Cheers,
John

From: eprints-tech-bounces@ecs.soton.ac.uk
[mailto:eprints-tech-bounces@ecs.soton.ac.uk]
On Behalf Of Derek Lawrie
Sent: 31 October 2013 12:38
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] {Disarmed} Re: Re: last additions rather than latest




Hi Seb,

That makes sense but my current page isn't outputting the "default"
citation (lib/citations/eprint/result.xml) because that file does not
exist. I do have a result.xml
in archives/<id>/cfg/citations/eprint/result.xml but it can't be using
that one either as it iterates out as tables cells and my page is div and
span based.
So id my page isn't using either of those citations, what is it using
(the mode in latest_tool.pl is exactly as you said)?



Again I'm not sure if I'm making sense?



Thanks

Derek







From:
Sebastien Francois <sf2@ecs.soton.ac.uk>
Reply-To: Eprints <eprints-tech@ecs.soton.ac.uk>
Date: Thursday, October 31, 2013 11:49 AM
To: Eprints <eprints-tech@ecs.soton.ac.uk>
Subject: [EP-tech] Re: last additions rather than latest



Hello,

>From lib/defaultcfg/cfg.d/latest_tool.pl:

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

# Example of a latest_tool mode. This makes a mode=articles option
# which only lists eprints who's type equals "article".
#
# articles => {
# citation => undef,
# filters => [
# { meta_fields => [ "type" ], value => "article" }
# ],
# max => 20
# }


You can see the "default" mode uses the "result" citation (i.e.
lib/citations/eprint/result.xml).

(but don't change this file directly, change your local copy in
archives/<id>/cfg/cfg.d/latest_tool.pl instead).

Seb.


On 31/10/13 11:42, Derek Lawrie wrote:




Looking at latest_tool I have no idea how I would create another mode or
how I would use it?
I can create a new citation easily enough, but again not really sure how
latest_tool would use it.
Not really sure what citation it's getting by default currently!
(assuming that it is)

Thanks
Derek


From: John Salter <J.Salter@leeds.ac.uk>

Reply-To: Eprints <eprints-tech@ecs.soton.ac.uk>

Date: Thursday, October 31, 2013 11:22 AM
To: Eprints <eprints-tech@ecs.soton.ac.uk>

Subject: [EP-tech] Re: last additions rather than latest


I’d look at the latest_tool.pl, making a new mode, and using a new
citation style.
http://wiki.eprints.org/w/Citation_Format
Have a poke about in ~/archives/ARCHIVEID/cfg/citations/ (both eprint and
document).

Let us know how you get on!
Cheers,
John

From: eprints-tech-bounces@ecs.soton.ac.uk
[mailto:eprints-tech-bounces@ecs.soton.ac.uk]
On Behalf Of Derek Lawrie
Sent: 31 October 2013 10:34
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] Re: last additions rather than latest





Hi,
Seb and John helped me enormously yesterday with getting the latest
additions onto the page, but no I'd like to customise the output of those
additions, giving more importance (slightly different styling) to one or
more items to distinguish them.
I see in latest_tool where it loops through the items, is it ok for me to
alter that? It's not going to break something on another page?
I'm also presuming that I can pull other content about the abstract into
this as well, I was thinking of using thumbnails on the homepage along
with the title text.

Does any of that make sense?

Thanks
Derek



From: Sebastien Francois <sf2@ecs.soton.ac.uk>


Reply-To: Eprints <eprints-tech@ecs.soton.ac.uk>


Date: Wednesday, October 30, 2013 11:16 AM
To: Eprints <eprints-tech@ecs.soton.ac.uk>


Subject: [EP-tech] Re: last additions rather than latest


Hi Derek,

No need for SSI (but feel free to use that trick), a simple Ajax request
will do:

<script type="text/_javascript_">
new Ajax.Updater( 'fplatest', '/cgi/latest_tool', { parameters: {
"mode":"fplatest", "mainonly":"yes" } } );
</script>

This would insert the latest additions to the element whose ID is
"fplatest" (the 1st param of Ajax.Updater).

Just adapt the code above just note the use of "mainonly = yes" to ask the
cgi to return only the page fragment/content rather than the entire html
document.

Seb.

On 30/10/13 11:11, Derek Lawrie wrote:




Thanks John, before I could even get a reply in asking how you would use
it!
Is it possible to then use that on the index/homepage?
I've read another entry on here with someone using php SSi's to do that,
wasn't sure if it was possible without that method?
(http://www.eprints.org/tech.php/thread-14164.html)

Thanks
Derek


Derek Lawrie
Web Developer and Administrator
T: 01603 751498 | Ext: 6498
w: www.nua.ac.uk <http://www.nua.ac.uk> <http://www.nua.ac.uk>
<http://www.nua.ac.uk>

<://www.nua.ac.uk>





Norwich University of the Arts, Francis House, 3-7 Redwell Street,
Norwich, NR2 4SN




From: John Salter <J.Salter@leeds.ac.uk>



Reply-To: Eprints <eprints-tech@ecs.soton.ac.uk>



Date: Wednesday, October 30, 2013 10:56 AM
To: Eprints <eprints-tech@ecs.soton.ac.uk>



Subject: [EP-tech] Re: last additions rather than latest


Bad form replying to myself (twice in a row too ­ sorry!).

For completeness,
http://your.repository/cgi/latest_tool?n=5 will show the 5 latest.




You can also configure some other defaults in
~/archives/ARCHIVEID/cfg/cfg.d/latest_tool.pl which are then called like
http://your.repository/cgi/latest_tool?mode=articles&n=5
(for the commented example in latest_tool.pl).

Cheers,
John

From: John Salter

Sent: 30 October 2013 10:31
To: 'eprints-tech@ecs.soton.ac.uk'
Subject: RE: last additions rather than latest



Try
http://your.repository/cgi/latest_tool - which displays the most recent 20



items by default (I think).
It¹s in here: ~/cgi/latest_tool
If you¹re running multiple repositories on one server, you can copy it to
~/archives/ARCHIVEID/cgi/ to create a repository-specific version of it.

Cheers,
John

From:eprints-tech-bounces@ecs.soton.ac.uk
[mailto:eprints-tech-bounces@ecs.soton.ac.uk]
On Behalf Of Derek Lawrie
Sent: 30 October 2013 09:25
To: Eprints
Subject: [EP-tech] last additions rather than latest





Hi,
Is it possible (I presume it is, just don't know how) to change the
"Latest Additions" to "Last Additions", I can't quite often go weeks
without anything being added and would prefer something was shown on the
page rather than leaving it empty.

Thanks
Derek

Rated top Specialist Arts Institution in the UK (National Student Survey
2013) and best Specialist Institution in Art and Design (Complete
University Guide 2014)

Internet communications cannot be guaranteed to be secure or error-free as
information could be intercepted, corrupted, lost, destroyed, arrive late
or incomplete, or contain viruses.
Therefore, we do not accept responsibility for any errors or omissions
that are present in this message, or any attachment, that have arisen as a
result of e-mail transmission. If verification is required, please request
a hard-copy version. Any views or opinions
presented are solely those of the author and do not necessarily represent
those of the University.


This email and any files sent with it are intended only for the named
recipient and may be confidential. If you are not the named recipient
please email the sender immediately then delete this message. You should
not disclose the content, distribute or retain
any copies of this message.


Norwich University of the Arts,
Francis House,
3-7 Redwell Street,
Norwich, NR2 4SN.
Tel: 01603 610561
Fax: 01603 615728
www.nua.ac.uk <http://www.nua.ac.uk> <http://www.nua.ac.uk>
<http://www.nua.ac.uk>

<http://www.nua.ac.uk>



NUA Business Limited
Registered office:
Francis House,
3-7 Redwell Street,
Norwich, NR2 4SN.
Registered in England & Wales number 3001912

Rated top Specialist Arts Institution in the UK (National Student Survey
2013) and best Specialist Institution in Art and Design (Complete
University
Guide 2014)

Internet communications cannot be guaranteed to be secure or error-free as
information could be intercepted, corrupted, lost, destroyed, arrive late
or incomplete, or contain viruses.
Therefore, we do not accept responsibility for any errors or omissions
that are present in this message, or any attachment, that have arisen as a
result of e-mail transmission. If verification is required, please request
a hard-copy version. Any views or opinions
presented are solely those of the author and do not necessarily represent
those of the University.


This email and any files sent with it are intended only for the named
recipient and may be confidential. If you are not the named recipient
please email the sender immediately then delete this message. You should
not disclose the content, distribute or retain
any copies of this message.


Norwich University of the Arts,
Francis House,
3-7 Redwell Street,
Norwich, NR2 4SN.
Tel: 01603 610561
Fax: 01603 615728
www.nua.ac.uk <http://www.nua.ac.uk> <http://www.nua.ac.uk>
<http://www.nua.ac.uk>



NUA Business Limited
Registered office:
Francis House,
3-7 Redwell Street,
Norwich, NR2 4SN.
Registered in England & Wales number 3001912



*** Options:
http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
<http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech>

*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/

Rated top Specialist Arts Institution in the UK (National Student Survey
2013) and best Specialist Institution in Art and Design (Complete
University Guide 2014)

Internet communications cannot be guaranteed to be secure or error-free as
information could be intercepted, corrupted, lost, destroyed, arrive late
or incomplete, or contain viruses.
Therefore, we do not accept responsibility for any errors or omissions
that are present in this message, or any attachment, that have arisen as a
result of e-mail transmission. If verification is required, please request
a hard-copy version. Any views or opinions
presented are solely those of the author and do not necessarily represent
those of the University.


This email and any files sent with it are intended only for the named
recipient and may be confidential. If you are not the named recipient
please email the sender immediately then delete this message. You should
not disclose the content, distribute or retain
any copies of this message.


Norwich University of the Arts,
Francis House,
3-7 Redwell Street,
Norwich, NR2 4SN.
Tel: 01603 610561
Fax: 01603 615728
www.nua.ac.uk <http://www.nua.ac.uk> <http://www.nua.ac.uk>


NUA Business Limited
Registered office:
Francis House,
3-7 Redwell Street,
Norwich, NR2 4SN.
Registered in England & Wales number 3001912

Rated top Specialist Arts Institution in the UK (National Student Survey
2013) and best Specialist Institution in Art and Design (Complete
University Guide 2014)

Internet communications cannot be guaranteed to be secure or error-free as
information could be intercepted, corrupted, lost, destroyed, arrive late
or incomplete, or contain
viruses. Therefore, we do not accept responsibility for any errors or
omissions that are present in this message, or any attachment, that have
arisen as a result of e-mail transmission. If verification is required,
please request a hard-copy version. Any views
or opinions presented are solely those of the author and do not
necessarily represent those of the University.


This email and any files sent with it are intended only for the named
recipient and may be confidential. If you are not the named recipient
please email the sender immediately then delete this message. You should
not disclose the content, distribute or retain
any copies of this message.


Norwich University of the Arts,
Francis House,
3-7 Redwell Street,
Norwich, NR2 4SN.
Tel: 01603 610561
Fax: 01603 615728
www.nua.ac.uk <http://www.nua.ac.uk>

NUA Business Limited
Registered office:
Francis House,
3-7 Redwell Street,
Norwich, NR2 4SN.
Registered in England & Wales number 3001912





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





Rated top Specialist Arts Institution in the UK (National Student Survey
2013) and best Specialist Institution in Art and Design (Complete
University Guide 2014)

Internet communications cannot be guaranteed to be secure or error-free as
information could be intercepted, corrupted, lost, destroyed, arrive late
or incomplete, or contain viruses.
Therefore, we do not accept responsibility for any errors or omissions
that are present in this message, or any attachment, that have arisen as a
result of e-mail transmission. If verification is required, please request
a hard-copy version. Any views or opinions
presented are solely those of the author and do not necessarily represent
those of the University.


This email and any files sent with it are intended only for the named
recipient and may be confidential. If you are not the named recipient
please email the sender immediately then delete this message. You should
not disclose the content, distribute or retain
any copies of this message.


Norwich University of the Arts,
Francis House,
3-7 Redwell Street,
Norwich, NR2 4SN.
Tel: 01603 610561
Fax: 01603 615728
www.nua.ac.uk <http://www.nua.ac.uk>

NUA Business Limited
Registered office:
Francis House,
3-7 Redwell Street,
Norwich, NR2 4SN.
Registered in England & Wales number 3001912

Rated top Specialist Arts Institution in the UK (National Student Survey 2013) and best Specialist Institution in Art and Design (Complete University Guide 2014)

Internet communications cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. Therefore, we do not accept responsibility for any errors or omissions that are present in this message, or any attachment, that have arisen as a result of e-mail transmission. If verification is required, please request a hard-copy version. Any views or opinions presented are solely those of the author and do not necessarily represent those of the University.

This email and any files sent with it are intended only for the named recipient and may be confidential. If you are not the named recipient please email the sender immediately then delete this message. You should not disclose the content, distribute or retain any copies of this message.


Norwich University of the Arts,
Francis House,
3-7 Redwell Street,
Norwich, NR2 4SN.
Tel: 01603 610561
Fax: 01603 615728
www.nua.ac.uk

NUA Business Limited
Registered office:
Francis House,
3-7 Redwell Street,
Norwich, NR2 4SN.
Registered in England & Wales number 3001912