EPrints Technical Mailing List Archive
See the EPrints wiki for instructions on how to join this mailing list and related information.
Message: #05956
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
Re: [EP-tech] Quick export plugin question
- To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
- Subject: Re: [EP-tech] Quick export plugin question
- From: John Salter <J.Salter@leeds.ac.uk>
- Date: Thu, 22 Sep 2016 08:39:18 +0000
Hi Robin, This example is from EPrints::Plugin::Export::DC: if( $eprint->exists_and_set( "subjects" ) ) { my $subjectid; foreach $subjectid ( @{$eprint->get_value( "subjects" )} ) { my $subject = EPrints::DataObj::Subject->new( $plugin->{session}, $subjectid ); # avoid problems with bad subjects next unless( defined $subject ); push @dcdata, [ "subject", EPrints::Utils::tree_to_utf8( $subject->render_description() ) ]; } } The reason this is a bit more complex than just outputting the value is that the subjects can be multi-lingual, so there is a translation from the stored value to the ‘human’ version in a specific language (even
if you’re not using them!) – based on the language used for the session. How should $data->{B} be constructed when there are multiple subjects? The ‘push @dcdata’ line should be changed to do whatever you need – maybe constructing a string that is then assigned to $data->{B}. Cheers, John From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk]
On Behalf Of Robin Sylvestre Hello everyone, I’m wondering if someone could help me here. Using an export plugin, I would like to export a value from a subject tree. Currently, the code is:
$data->{B} = $dataobj->get_value( "divisions" ) if $dataobj->exists_and_set( "divisions" ); This works, but it exports the “subject ID string” rather than the rendered subject.
How can I export the associated subject instead of the ID? Our archive is multilingual but these “subjects” are in only one language. Thanks! Robin Sylvestre Technicien en documentation Services techniques et systèmes informatisés Bibliothèque Louise-Lalonde-Lamarre École Polytechnique de Montréal Tél.: 514-340-4711 poste 3743 |
- References:
- [EP-tech] Quick export plugin question
- From: Robin Sylvestre <robin.sylvestre@polymtl.ca>
- [EP-tech] Quick export plugin question
- Prev by Date: Re: [EP-tech] Quick export plugin question
- Next by Date: Re: [EP-tech] Quick export plugin question
- Previous by thread: [EP-tech] Quick export plugin question
- Next by thread: Re: [EP-tech] Quick export plugin question
- Index(es):