EPrints Technical Mailing List Archive
See the EPrints wiki for instructions on how to join this mailing list and related information.
Message: #04688
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
[EP-tech] Re: How to set a field to be multilang (Imports brake)
- To: eprints-tech@ecs.soton.ac.uk
- Subject: [EP-tech] Re: How to set a field to be multilang (Imports brake)
- From: Adam Field <af05v@ecs.soton.ac.uk>
- Date: Tue, 15 Sep 2015 18:19:22 +0100
Sorry, I had a UKCoRR event, a German Language User Group Meeting, a Hack Day and a UK User Group Meeting all in the last two weeks, which were my first two weeks back from Annual Leave! I think we'll need to override set_value on our Virtualwithvalue metafield class. Before we added code to pull values out of another field. We need code now to insert values into another field. Something like this (add it to the code below in the email of June 30th): #In the field class (Virtualwithvalue?) sub set_value { my( $self, $object, $value ) = @_; if ( defined $self->get_property("set_value") ) { return $self->call_property( "set_value", $object, $value); } return undef; } ...and in get_property_defaults: $defaults{set_value} = undef; ...then in any field definitions in the repository config (along the lines of get_value discussed previously): set_value => sub { my ($eprint, $value) = @_; #only use this on imports, NOT if the value is already set if ($eprint->is_set('ml_title')) { return; } $eprint->set_value('title_ml', [text => '$value', lang => $c->{defaultlanguage} ]); } I leave is as an exercise for the reader to debug the above code, which hasn't even been parsed, let alone tested. Please feedback with tested code, and some documentation on the wiki :) -- Adam Field Business Relationship Manager and Community Lead EPrints Services
|
- References:
- [EP-tech] Re: How to set a field to be multilang
- From: Timothy Miles-Board <timothy.miles-board@ulcc.ac.uk>
- [EP-tech] Re: [Solved] Re: [spam?] Re: How to set a field to be multilang
- From: George Mamalakis <mamalos@eng.auth.gr>
- [EP-tech] Re: [Solved] Re: [spam?] Re: How to set a field to be multilang
- From: "Field A.N." <af05v@ecs.soton.ac.uk>
- [EP-tech] Re: [Solved] Re: [spam?] Re: How to set a field to be multilang
- From: George Mamalakis <mamalos@eng.auth.gr>
- [EP-tech] Re: How to set a field to be multilang (Imports brake)
- From: George Mamalakis <mamalos@eng.auth.gr>
- [EP-tech] Re: How to set a field to be multilang (Imports brake)
- From: alen vodopijevec <alen@irb.hr>
- [EP-tech] Re: How to set a field to be multilang (Imports brake)
- From: George Mamalakis <mamalos@eng.auth.gr>
- [EP-tech] Re: How to set a field to be multilang (Imports brake)
- From: alen vodopijevec <alen@irb.hr>
- [EP-tech] Re: How to set a field to be multilang (Imports brake)
- From: George Mamalakis <mamalos@eng.auth.gr>
- [EP-tech] Re: How to set a field to be multilang
- Prev by Date: [EP-tech] Re: Some questions about SWORDv2/CRUD endpoint
- Next by Date: [EP-tech] Re: Antwort: Re: IRStats2 extension
- Previous by thread: [EP-tech] Re: How to set a field to be multilang (Imports brake)
- Next by thread: [EP-tech] Re: How to set a field to be multilang (Imports brake)
- Index(es):