EPrints Technical Mailing List Archive
Message: #04837
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
[EP-tech] Re: Updating a compound multiple field
- To: eprints-tech@ecs.soton.ac.uk
- Subject: [EP-tech] Re: Updating a compound multiple field
- From: George Mamalakis <mamalos@eng.auth.gr>
- Date: Fri, 02 Oct 2015 17:53:36 +0300
Hi Martin,
I'm not sure I've tested it (I've used an API script to populate compound fields (multilang fields in particular) where values were stored using set_value() in the way you're mentioning), but if it doesn't do so then it's API behaviour would be counter to the other fields' behaviour. My script was something like that: use Data::Dumper; my $ep = EPrints->new(); my $repo = $ep->repository( "myrepo" ); my $ds = $repo->dataset("archive"); my $list = $ds->search; my $n = $list->count(); my @docs = $list->slice(0, $n); foreach $d (@docs) { if ($d->is_set('ml_title')) { print "item with id " . $d->id . " has ml_title set\n"; } else { if ($d->is_set('title')) { # print "Updating ml_title for eprint.id = " . $d->id . "\n"; my $tit = $d->get_value('title'); my @ml_tit = [ {lang=>'en', text=>$tit}, {lang=>'el', text=>$tit} ]; # print Dumper(@ml_tit); $d->set_value('ml_title', @ml_tit); $d->commit(); } } } I don't know, this may help you test your case... On 02/10/2015 05:37 μμ, martin.braendle@id.uzh.ch wrote:
-- George Mamalakis IT and Security Officer, Electrical and Computer Engineer (Aristotle Univ. of Thessaloniki), PhD (Aristotle Univ. of Thessaloniki), MSc (Imperial College of London) School of Electrical and Computer Engineering Aristotle University of Thessaloniki phone number : +30 (2310) 994379 |
- References:
- [EP-tech] Updating a compound multiple field
- From: martin.braendle@id.uzh.ch
- [EP-tech] Updating a compound multiple field
- Prev by Date: [EP-tech] Updating a compound multiple field
- Next by Date: [EP-tech] Re: Updating a compound multiple field
- Previous by thread: [EP-tech] Updating a compound multiple field
- Next by thread: [EP-tech] Re: Updating a compound multiple field
- Index(es):