EPrints Technical Mailing List Archive

Message: #03059


< 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: Re: Re: Adding fields to admin search


Thanks both for your help on this; a couple of the fields we’re looking to add are custom ones which are in the sprint__ordervalues_en database. I can refer to publisher directly in Gilles’ solution however when I try to include these two fields I’m told that they’re not valid metadata; do I need to refer to them in a specific way?

From: Gilles Fournié <gilles.fournie@cirad.fr<mailto:gilles.fournie@cirad.fr>>
Organization: Cirad
Reply-To: "eprints-tech@ecs.soton.ac.uk<mailto:eprints-tech@ecs.soton.ac.uk>" <eprints-tech@ecs.soton.ac.uk<mailto:eprints-tech@ecs.soton.ac.uk>>
Date: Thursday, 22 May 2014 07:12
To: "eprints-tech@ecs.soton.ac.uk<mailto:eprints-tech@ecs.soton.ac.uk>" <eprints-tech@ecs.soton.ac.uk<mailto:eprints-tech@ecs.soton.ac.uk>>
Subject: [EP-tech] {Disarmed} Re: Re: Re: Re: Adding fields to admin search

Hi John,

You were right.

If I modify this file, changing :

    if( $dataset->base_id eq "eprint" )

into

    if( $dataset->base_id eq "eprint" && $searchid ne 'staff' )

the field is shown in the search form...

Thanks !
Gilles


Le 21/05/2014 15:36, John Salter a écrit :
HI Gilles,
For your first question, it looks like ‘metadata_visibility’ might already be set when the search is set up:
https://github.com/eprints/eprints/blob/3.3/cgi/search#L96-L100
I’m not sure if EPrints will then ignore this field, as it’s already used?

Not sure about your second question.

Cheers,
John

From: eprints-tech-bounces@ecs.soton.ac.uk<mailto:eprints-tech-bounces@ecs.soton.ac.uk> [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Gilles Fournié
Sent: 21 May 2014 13:41
To: eprints-tech@ecs.soton.ac.uk<mailto:eprints-tech@ecs.soton.ac.uk>
Subject: [EP-tech] {Disarmed} Re: Re: Adding fields to admin search

Hi,

We are also on 3.3.12. On our server, the search url is MailScanner has detected a possible fraud attempt from "..." claiming to be .../cgi/search/eprint/staff<http://.../cgi/search/eprint/staff>

Looking for one of the fieldnames appearing in the form ('eprint_status'), I found a file in lib (lib/cfg.d/eprint_search_staff.pl).
It was not in the cfg.d directory for our archive.
So I copied it from lib/cfg.d to archives/.../cfg/cfg.d.

I tried to add a few columns found in the eprint table and it seems to allow us to change the meta fields that appear in the search form.
Hope this would help you.

I also had related questions for the list :

  *   I added "metadata_visibility" to the staff search form, but this field is not shown (the other ones I added (importid and num_pieces) do). Any idea why ?
  *   Is there a place where I could find a list and a description of all meta fields ?

Thanks
Gilles

Le 21/05/2014 13:39, Andrew Beeken a écrit :

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><mailto: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>

[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<mailto: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/






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