EPrints Technical Mailing List Archive

Message: #03056


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

[EP-tech] Re: Adding fields to admin search


- Just seen Gilles reply - read that first - it's more concise! I'd already typed most of this - sending it for reference!

I'm glad I put that '3.3.10' caveat in my reply :o)
It works wonderfully for that version.

For 3.3.12, I'm basing this on the GitHub repo.
1. Same screen: https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/Plugin/Screen/Staff/EPrintSearch.pm
2. Entirely different to 3.3.10.
3. Looks like it redirects the search to .../cgi/search/eprint/staff
4. Look at cgi/search https://github.com/eprints/eprints/blob/3.3/cgi/search 
5. This splits the incoming part to make 'eprint' the $datasetid, and 'staff' to be the $searchid.
6. The searching is then done by https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/Plugin/Screen/Search.pm
7. Which in turn calls 'search_config' from the dataset: https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/DataSet.pm
8. Eventually ending up at this line: 
	$repo->config( "search", $searchid );
9. And searching the code/GitHub: https://github.com/eprints/eprints/blob/3.3/lib/cfg.d/eprint_search_staff.pl - make note of the comments at the top!
10. Someone write it all up for the Wiki :o)

Cheers,
John


-----Original Message-----
From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Andrew Beeken
Sent: 21 May 2014 12:40
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] Re: Adding fields to admin search

Hi John,

We¹re on 3.3.12 here - I¹ve tried what you suggested to no avail. To be
honest, I¹m not sure where you¹re getting the search config information
from; I¹m following you up til point 4 okay but I don¹t see anything in
that file to indicate what config to use :/



On 21/05/2014 11:56, "John Salter" <J.Salter@leeds.ac.uk> wrote:

>Hi,
>Good question. One I didn¹t know the answer to until I had a quick look.
>
>This is my thought process:
>1. Log in to EPrints, go to the admin search page.
>2. Look at the URL. It ends with screen=Staff%3A%3AEPrintSearch
>3. Mentally convert the screen parameter above to a file to look at -
>resulting in: ~/perl_lib/EPrints/Plugin/Screen/Staff/EPrintSearch.pm.
>4. See what search config it uses [search->advanced->search_fields] AND
>something a bit *magic* looking 'extra_fields' (sounds like exactly what
>we need :o).
>5. Grep rest of EPrints code to find other mentions of 'extra_fields'.
>6. Be disappointed.
>7. Look at: http://wiki.eprints.org/w/API:EPrints/Plugin#param
>8. Think that adding:
>$c->{plugins}->{"Screen::Staff::EPrintSearch"}->{params}->{extra_fields}
>= ...SOMETHING...;
>is the way forward, SOMETHING being some config similar to the existing
>search config options.
>9. Decide to leave the next step for you, with the hope you add the
>recipe to the 'How To' section of the wiki:
>http://wiki.eprints.org/w/Category:Howto
>10. Lunch! Sunshine!
>11. Actually, I'm interested. What should that SOMETHING be..?
>12. Add this to a file in ~/archives/cfg/cfg.d/ (possibly the
>eprint_search_advanced.pl, or plugins.pl, or some other file that you'll
>be able to find it in again!):
>########
>#Additional field for internal staff search
>########
>$c->{plugins}->{"Screen::Staff::EPrintSearch"}->{params}->{extra_fields}
>= [
>                { meta_fields => [ "id_number" ] },
>                { meta_fields => [ "documents.license" ] },
>];
>
>NB: This is based on 3.3.10.
>
>Cheers,
>John
>
>-----Original Message-----
>From: eprints-tech-bounces@ecs.soton.ac.uk
>[mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Andrew Beeken
>Sent: 20 May 2014 16:14
>To: eprints-tech@ecs.soton.ac.uk
>Subject: [EP-tech] Adding fields to admin search
>
>Hello!
>
>I¹ve now been asked to add some fields to the admin search screen in
>EPrints. I¹ve found a snippet here:
>http://trac.eprints.org/eprints/ticket/3637 which suggests how different
>fields can be added in, however the function in question is different in
>the version of EPrints we are running. So, any thoughts on how we can do
>this? The Trac page suggests that this was put forward to be added to a
>future version of EPrints as an admin function, however I presume this
>has yet to happen?
>
>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/


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