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

Gilles Fournié gilles.fournie at cirad.fr
Wed May 21 13:41:16 BST 2014


Hi,

We are also on 3.3.12. On our server, the search url is 
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 at 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 at ecs.soton.ac.uk
>> [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Andrew Beeken
>> Sent: 20 May 2014 16:14
>> To: eprints-tech at 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/
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20140521/55ee682e/attachment.html 


More information about the Eprints-tech mailing list