EPrints Technical Mailing List Archive
Message: #04277
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
[EP-tech] Re: Setting a date (as a sub-field)
- To: eprints-tech@ecs.soton.ac.uk
- Subject: [EP-tech] Re: Setting a date (as a sub-field)
- From: Ian Stuart <Ian.Stuart@ed.ac.uk>
- Date: Thu, 28 May 2015 15:49:59 +0100
On 28/05/15 15:32, Timothy Miles-Board wrote:
Hi Ian, Have you seen https://github.com/eprintsug/datesdatesdates
I hadn't... and it's almost identical to what I created it worked fine for you, yes? my $ds = $session->dataset( 'archive' ); my $list = $ds->search; $list->map( sub { my( $session, $dataset, $eprint ) = @_; my ($date, $type); ($date, $type) = ($eprint->value('date'), $eprint->value('date_type')); if ($date) { my $new_date = {date => $date}; #, dates_type => $type}; print "Date: $date; Dates: ", Dumper $new_date; if ( $date =~ /\d+\-\d+\-\d+/ ) { print "Altering the date recording on #".$eprint->id."\n"; $eprint->set_value( 'dates', [$new_date] ); } } $eprint->commit; } );Interestingly..... if I add a "sleep 2" after the commit, the ERRORs don't appear for 6 or 7 iterations!
-- Ian Stuart. Developer: ORI, RJ-Broker, and OpenDepot.org Bibliographics and Multimedia Service Delivery team, EDINA, The University of Edinburgh. http://edina.ac.uk/ This email was sent via the University of Edinburgh. The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
- References:
- [EP-tech] Setting a date (as a sub-field)
- From: Ian Stuart <Ian.Stuart@ed.ac.uk>
- [EP-tech] Re: Setting a date (as a sub-field)
- From: "Field A.N." <af05v@ecs.soton.ac.uk>
- [EP-tech] Re: Setting a date (as a sub-field)
- From: Timothy Miles-Board <timothy.miles-board@ulcc.ac.uk>
- [EP-tech] Setting a date (as a sub-field)
- Prev by Date: [EP-tech] Re: Setting a date (as a sub-field)
- Next by Date: [EP-tech] Re: 2 IRStats Questions
- Previous by thread: [EP-tech] Re: Setting a date (as a sub-field)
- Next by thread: [EP-tech] Upgradation from 3.1 to 3.3 - Many options are not visible
- Index(es):