EPrints Technical Mailing List Archive

Message: #05697


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

Re: [EP-tech] Simple meta data select list populated by file?


Thanks for the suggestion, Adam.  In this situation the autocomplete wouldn’t be exactly right, I think, as I want to use a multi-select list rather than a text box.  But I will certainly bare that in mind if I need to add another type of field (which I will undoubtedly have to!)

 

Cheers,

 

Andy

 

 

From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Adam Field
Sent: 13 May 2016 11:43 am
To: eprints-tech@ecs.soton.ac.uk
Subject: Re: [EP-tech] Simple meta data select list populated by file?

 

Could you write them to a file and use simple autocompletion?  It wouldn't force the user to select a value, but it would suggest the values.

 

 

Jisc

Adam Field
SHERPA services analyst developer

 

From: <eprints-tech-bounces@ecs.soton.ac.uk> on behalf of Enio Carboni <enio.carboni@gmail.com>
Reply-To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
Date: Friday, 13 May 2016 11:24
To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
Subject: Re: [EP-tech] Simple meta data select list populated by file?

 

Hi Andrew,

 i use the options "render_input" and "fromform" to populate my dynamic field (from Oracle database).
you should write some perl code but once you doyou'll get satisfaction

Yo can check this options in eprints wiki
http://wiki.eprints.org/w/Category:EPrints_Metadata_Fields

 Enio
Il 12/05/2016 13:31, Andrew Collington ha scritto:

Hi all,

 

Is it possible to have a simple, multi-select list as a new metadata field but have the values populated by a files?  What I’ve got is a list of research units that may dynamically change (they’re stored in an Oracle database).  The simplest thing I thought would be possible is to just generate an alphabetical list of those units into a file and use that file as the options in the select list.

 

What I thought I could try first was a namedset, so I added to eprints_fields.pl the following:

 

     {
             allow_null => 1,
             multiple => 1,
             name => 'research_units',
             required => 0,
             set_name => 'research_units',
             type => 'namedset',
     },

 

And added the namedsets/research_units file with the list of units (one per line).  Naturally that didn’t work – clearly I misunderstood the namedsets a bit as it still required a phrase set up for each entry.

 

I could possibly use the ‘subjects’ file and set up a new group within that.  Ideally, though, I’d like to avoid touching that file altogether as the units may change over time and I’d like to automate the process of getting the new list into eprints.

 

If it’s not possible to populate from a simple file, then are there any other options?  Would it come down to writing my own dataset object (or something like that?), or could the result be taken from a remote web service or something like that?

 

Many thanks for any hints in the right direction!

 

Andy

 

 




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

 


Jisc is a registered charity (number 1149740) and a company limited by guarantee which is registered in England under Company No. 5747339, VAT No. GB 197 0632 86. Jisc’s registered office is: One Castlepark, Tower Hill, Bristol, BS2 0JA. T 0203 697 5800.

Jisc Services Limited is a wholly owned Jisc subsidiary and a company limited by guarantee which is registered in England under company number 2881024, VAT number GB 197 0632 86. The registered office is: One Castle Park, Tower Hill, Bristol BS2 0JA. T 0203 697 5800.