EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #05964


< 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


Denis

 

                http://wiki.eprints.org/w/Frequently_Asked_Questions#How_can_I_get_a_utf8_string_of_the_name_of_a_subject.2C_given_its_subjectid.3F

 

                …though admittedly I found it by doing a search for ‘tree_to_utf8’.  The problem, as always, is the way the wiki sprawls.  Unfortunately, this is something of a specific, arcane detail, so we need a way of filing it with all the other arcane details that still makes it discoverable.

 

                If you have ideas of how this could be done better, feel free to get involved.  There’s even a training video to help you get started: http://wiki.eprints.org/w/Training_Video:EPrints_Wiki_Basics

 

Adam Field
SHERPA services analyst developer

 

 

From: Denis Pitzalis <denis.pitzalis@gmail.com>
Date: Monday, 26 September 2016 09:49
To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>, Adam Field <Adam.Field@jisc.ac.uk>, Robin Sylvestre <robin.sylvestre@polymtl.ca>
Subject: Re: [EP-tech] Quick export plugin question

 

Hi Robert, thanks for this.
However me either I did not know about using tree_to_utf8 with arguments, probably because it is undocumented or buried in some 205 wiki pages?

On 26 September 2016 10:45:38 CEST, Adam Field <Adam.Field@jisc.ac.uk> wrote:

Cool – I’ve never used tree_to_utf8 with extra arguments.  I learned something today J

 

 

Adam Field
SHERPA services analyst developer

 

 

From: Robin Sylvestre <robin.sylvestre@polymtl.ca>
Date: Friday, 23 September 2016 20:22
To: Adam Field <Adam.Field@jisc.ac.uk>, "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
Subject: RE: [EP-tech] Quick export plugin question

 

Thanks everyone for your help!

 

I tweaked Adam’s code a bit and I managed to get exactly what I wanted with:

 

$data->{B} = EPrints::Utils::tree_to_utf8($dataobj->render_value('divisions') , undef , undef , undef , 1) if $dataobj->exists_and_set('divisions');

 

Have a nice weekend!

 

Robin

 

 

De : Adam Field [mailto:Adam.Field@jisc.ac.uk]
Envoyé : 22 septembre 2016 05:44
À : eprints-tech@ecs.soton.ac.uk
Objet : Re: [EP-tech] Quick export plugin question

 

Depending on the structure of your subject tree, you might get away with:

 

$data->{B} = EPrints::Utils::tree_to_utf8($dataobj->render_value(‘divisions’)) if $dataobj->exists_and_set(‘divisions’);

 

 

 

Adam Field
SHERPA services analyst developer

 

 

From: <eprints-tech-bounces@ecs.soton.ac.uk> on behalf of Robin Sylvestre <robin.sylvestre@polymtl.ca>
Reply-To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
Date: Wednesday, 21 September 2016 21:55
To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
Subject: [EP-tech] Quick export plugin question

 

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!

 

age supprimée par l'expéditeur. ttp://www.polymtl.ca/sc/img/logoType/log

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


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.

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


--
Sent from my Android device with K-9 Mail. Please excuse my brevity.