[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[EP-tech] Quick export plugin question
- Subject: [EP-tech] Quick export plugin question
- From: Adam.Field at jisc.ac.uk (Adam Field)
- Date: Mon, 26 Sep 2016 08:45:38 +0000
- In-reply-to: <001a01d215cf$d76cefe0$8646cfa0$@polymtl.ca>
- References: <22E04FF7-8D60-472F-835D-E9926AC75932@jisc.ac.uk> <001a01d215cf$d76cefe0$8646cfa0$@polymtl.ca>
Cool ? I?ve never used tree_to_utf8 with extra arguments. I learned something today ?
[cid:image001.png at 01D217DA.C250A4A0]<http://www.jisc.ac.uk/>
Adam Field
SHERPA services analyst developer
From: Robin Sylvestre <robin.sylvestre at polymtl.ca>
Date: Friday, 23 September 2016 20:22
To: Adam Field <Adam.Field at jisc.ac.uk>, "eprints-tech at ecs.soton.ac.uk" <eprints-tech at 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 at jisc.ac.uk]
Envoy? : 22 septembre 2016 05:44
? : eprints-tech at 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?);
[cid:image002.png at 01D217DA.C250A4A0]<http://www.jisc.ac.uk/>
Adam Field
SHERPA services analyst developer
From: <eprints-tech-bounces at ecs.soton.ac.uk> on behalf of Robin Sylvestre <robin.sylvestre at polymtl.ca>
Reply-To: "eprints-tech at ecs.soton.ac.uk" <eprints-tech at ecs.soton.ac.uk>
Date: Wednesday, 21 September 2016 21:55
To: "eprints-tech at ecs.soton.ac.uk" <eprints-tech at 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!
[mage 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20160926/37f23002/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 1264 bytes
Desc: image001.png
Url : http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20160926/37f23002/attachment-0003.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 5444 bytes
Desc: image002.png
Url : http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20160926/37f23002/attachment-0004.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 1494 bytes
Desc: image003.png
Url : http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20160926/37f23002/attachment-0005.png