<html v="urn:schemas-microsoft-com:vml" o="urn:schemas-microsoft-com:office:office" w="urn:schemas-microsoft-com:office:word" m="http://schemas.microsoft.com/office/2004/12/omml" mv="http://macVmlSchemaUri"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="Title" content="" /><meta name="Keywords" content="" /><meta name="Generator" content="Microsoft Word 15 (filtered medium)" /><style><!--
/* Font Definitions */
@font-face
 {font-family:"Courier New";
 panose-1:2 7 3 9 2 2 5 2 4 4;}
@font-face
 {font-family:Wingdings;
 panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
 {font-family:Sylfaen;
 panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
 {font-family:"Cambria Math";
 panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
 {font-family:Calibri;
 panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
 {font-family:Corbel;
 panose-1:2 11 5 3 2 2 4 2 2 4;}
@font-face
 {font-family:PMingLiU;
 panose-1:2 2 5 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
 {margin:0cm;
 margin-bottom:.0001pt;
 font-size:11.0pt;
 font-family:Calibri;}
a:link, span.MsoHyperlink
 {mso-style-priority:99;
 color:#0563C1;
 text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
 {mso-style-priority:99;
 color:#954F72;
 text-decoration:underline;}
span.EmailStyle17
 {mso-style-type:personal;
 font-family:"Sylfaen","serif";
 color:windowtext;
 font-weight:normal;
 font-style:normal;
 text-decoration:none none;}
span.EmailStyle18
 {mso-style-type:personal;
 font-family:Calibri;
 color:windowtext;}
span.EmailStyle19
 {mso-style-type:personal;
 font-family:Calibri;
 color:#1F497D;}
span.EmailStyle20
 {mso-style-type:personal-reply;
 font-family:Calibri;
 color:windowtext;}
span.msoIns
 {mso-style-type:export-only;
 mso-style-name:"";
 text-decoration:underline;
 color:teal;}
.MsoChpDefault
 {mso-style-type:export-only;
 font-size:10.0pt;}
@page WordSection1
 {size:612.0pt 792.0pt;
 margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
 {page:WordSection1;}
--></style></head><body bgcolor="white" lang="EN-US" link="#0563C1" vlink="#954F72">Hi Robert, thanks for this. <br>
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?<br><br><div class="gmail_quote">On 26 September 2016 10:45:38 CEST, Adam Field &lt;Adam.Field@jisc.ac.uk&gt; wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">






<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]-->


<div class="WordSection1">
<p class="MsoNormal">Cool – I’ve never used tree_to_utf8 with extra arguments.&nbsp; I learned something today
<span style="font-family:Wingdings">J</span></p><p></p>
<p class="MsoNormal"></p><p>&nbsp;</p>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Times New Roman&quot;;color:black">&nbsp;<p></p></span></p>









<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td valign="top" style="border:none;border-top:solid #2C3841 1.0pt;padding:0cm 0cm 3.0pt 0cm">
<p class="MsoNormal"><a href="http://www.jisc.ac.uk/"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;color:blue;text-decoration:none"><img border="0" width="60" height="35" id="_x0000_i1027" src="cid:image001.png@01D217DA.C250A4A0" /></span></a></p><p></p>
</td></tr><tr><td valign="top" style="padding:7.5pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:12.0pt;font-family:Corbel;color:#2C3841">Adam Field</span></b><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;"><br />
</span><span style="font-size:12.0pt;font-family:Corbel;color:#2C3841">SHERPA services analyst developer</span></p><p></p>
</td></tr></tbody></table>
</div>
<p class="MsoNormal"></p><p>&nbsp;</p>
<p class="MsoNormal"></p><p>&nbsp;</p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="color:black">From: </span></b><span style="color:black">Robin Sylvestre &lt;robin.sylvestre@polymtl.ca&gt;<br />
<b>Date: </b>Friday, 23 September 2016 20:22<br />
<b>To: </b>Adam Field &lt;Adam.Field@jisc.ac.uk&gt;, &quot;eprints-tech@ecs.soton.ac.uk&quot; &lt;eprints-tech@ecs.soton.ac.uk&gt;<br />
<b>Subject: </b>RE: [EP-tech] Quick export plugin question</span><span style="font-size:12.0pt;color:black"><p></p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Times New Roman&quot;"><p>&nbsp;</p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-CA" style="color:#1F497D">Thanks everyone for your help!</span></p><p></p>
<p class="MsoNormal"><span lang="EN-CA" style="color:#1F497D">&nbsp;</span></p><p></p>
<p class="MsoNormal"><span lang="EN-CA" style="color:#1F497D">I tweaked Adam’s code a bit and I managed to get exactly what I wanted with:</span></p><p></p>
<p class="MsoNormal"><span lang="EN-CA" style="color:#1F497D">&nbsp;</span></p><p></p>
<p class="MsoNormal">$data-&gt;{B} = EPrints::Utils::tree_to_utf8($dataobj-&gt;render_value('divisions') , undef , undef , undef , 1) if $dataobj-&gt;exists_and_set('divisions');</p><p></p>
<p class="MsoNormal">&nbsp;</p><p></p>
<p class="MsoNormal"><span lang="EN-CA" style="color:#1F497D">Have a nice weekend!</span></p><p></p>
<p class="MsoNormal"><span lang="EN-CA" style="color:#1F497D">&nbsp;</span></p><p></p>
<p class="MsoNormal"><span lang="EN-CA" style="color:#1F497D">Robin</span></p><p></p>
<p class="MsoNormal"><span lang="EN-CA" style="color:#1F497D">&nbsp;</span></p><p></p>
<p class="MsoNormal"><span lang="EN-CA" style="color:#1F497D">&nbsp;</span></p><p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="FR">De&nbsp;:</span></b><span lang="FR"> Adam Field [mailto:Adam.Field@jisc.ac.uk]
<br />
<b>Envoyé&nbsp;:</b> 22 septembre 2016 05:44<br />
<b>À&nbsp;:</b> eprints-tech@ecs.soton.ac.uk<br />
<b>Objet&nbsp;:</b> Re: [EP-tech] Quick export plugin question</span></p><p></p>
</div>
</div>
<p class="MsoNormal">&nbsp;</p><p></p>
<p class="MsoNormal">Depending on the structure of your subject tree, you might get away with:</p><p></p>
<p class="MsoNormal">&nbsp;</p><p></p>
<p class="MsoNormal">$data-&gt;{B} = EPrints::Utils::tree_to_utf8($dataobj-&gt;render_value(‘divisions’)) if $dataobj-&gt;exists_and_set(‘divisions’);</p><p></p>
<p class="MsoNormal">&nbsp;</p><p></p>
<p class="MsoNormal">&nbsp;</p><p></p>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Times New Roman&quot;;color:black">&nbsp;</span></p><p></p>









<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td valign="top" style="border:none;border-top:solid #2C3841 1.0pt;padding:0cm 0cm 3.0pt 0cm">
<p class="MsoNormal"><a href="http://www.jisc.ac.uk/"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;;color:blue;text-decoration:none"><img border="0" width="60" height="35" id="_x0000_i1025" src="cid:image002.png@01D217DA.C250A4A0" /></span></a></p><p></p>
</td></tr><tr><td valign="top" style="padding:7.5pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:12.0pt;font-family:Corbel;color:#2C3841">Adam Field</span></b><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;"><br />
</span><span style="font-size:12.0pt;font-family:Corbel;color:#2C3841">SHERPA services analyst developer</span></p><p></p>
</td></tr></tbody></table>
</div>
<p class="MsoNormal">&nbsp;</p><p></p>
<p class="MsoNormal">&nbsp;</p><p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="color:black">From: </span></b><span style="color:black">&lt;eprints-tech-bounces@ecs.soton.ac.uk&gt; on behalf of Robin Sylvestre &lt;robin.sylvestre@polymtl.ca&gt;<br />
<b>Reply-To: </b>&quot;eprints-tech@ecs.soton.ac.uk&quot; &lt;eprints-tech@ecs.soton.ac.uk&gt;<br />
<b>Date: </b>Wednesday, 21 September 2016 21:55<br />
<b>To: </b>&quot;eprints-tech@ecs.soton.ac.uk&quot; &lt;eprints-tech@ecs.soton.ac.uk&gt;<br />
<b>Subject: </b>[EP-tech] Quick export plugin question</span></p><p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Times New Roman&quot;">&nbsp;</span></p><p></p>
</div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:&quot;Sylfaen&quot;,&quot;serif&quot;">Hello everyone,</span></p><p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:&quot;Sylfaen&quot;,&quot;serif&quot;">&nbsp;</span></p><p></p>
<p class="MsoNormal"><span lang="EN-CA" style="font-size:12.0pt;font-family:&quot;Sylfaen&quot;,&quot;serif&quot;">I’m wondering if someone could help me here. Using an export plugin, I would like to export a value from a subject tree.</span></p><p></p>
<p class="MsoNormal"><span lang="EN-CA" style="font-size:12.0pt;font-family:&quot;Sylfaen&quot;,&quot;serif&quot;">&nbsp;</span></p><p></p>
<p class="MsoNormal"><span lang="EN-CA" style="font-size:12.0pt;font-family:&quot;Sylfaen&quot;,&quot;serif&quot;">Currently, the code is:
</span></p><p></p>
<p class="MsoNormal"><span style="font-family:&quot;Courier New&quot;">&nbsp;</span></p><p></p>
<p class="MsoNormal"><span lang="EN-CA" style="font-family:&quot;Courier New&quot;">$data-&gt;{B} = $dataobj-&gt;get_value( &quot;divisions&quot; ) if $dataobj-&gt;exists_and_set( &quot;divisions&quot; );</span></p><p></p>
<p class="MsoNormal"><span lang="EN-CA" style="font-family:&quot;Courier New&quot;">&nbsp;</span></p><p></p>
<p class="MsoNormal"><span lang="EN-CA" style="font-size:12.0pt;font-family:&quot;Sylfaen&quot;,&quot;serif&quot;">This works, but it exports the “subject ID string” rather than the rendered subject.
</span></p><p></p>
<p class="MsoNormal"><span lang="EN-CA" style="font-size:12.0pt;font-family:&quot;Sylfaen&quot;,&quot;serif&quot;">&nbsp;</span></p><p></p>
<p class="MsoNormal"><span lang="EN-CA" style="font-size:12.0pt;font-family:&quot;Sylfaen&quot;,&quot;serif&quot;">How can I export the associated subject instead of the ID? Our archive is multilingual but these “subjects” are in only one language.</span></p><p></p>
<p class="MsoNormal"><span lang="EN-CA" style="font-size:12.0pt;font-family:&quot;Sylfaen&quot;,&quot;serif&quot;">&nbsp;</span></p><p></p>
<p class="MsoNormal"><span lang="EN-CA" style="font-size:12.0pt;font-family:&quot;Sylfaen&quot;,&quot;serif&quot;">Thanks!</span></p><p></p>
<p class="MsoNormal"><span lang="EN-CA" style="font-size:12.0pt;font-family:&quot;Sylfaen&quot;,&quot;serif&quot;">&nbsp;</span></p><p></p>
<p class="MsoNormal"><span style="border:solid windowtext 1.0pt;padding:0cm"><img border="0" width="174" height="83" id="_x0000_i1026" src="cid:image003.png@01D217DA.C250A4A0" alt="mage supprimée par l'expéditeur. ttp://www.polymtl.ca/sc/img/logoType/log" /></span></p><p></p>
<p class="MsoNormal"><b><span style="color:black">Robin Sylvestre</span></b></p><p></p>
<p class="MsoNormal"><span style="color:black">Technicien en documentation</span></p><p></p>
<p class="MsoNormal"><span style="color:black">Services techniques et systèmes informatisés</span></p><p></p>
<p class="MsoNormal"><span style="color:black">Bibliothèque Louise-Lalonde-Lamarre</span></p><p></p>
<p class="MsoNormal"><span style="color:black">École Polytechnique de Montréal</span></p><p></p>
<p class="MsoNormal"><span style="color:black">Tél.: 514-340-4711 poste 3743</span></p><p></p>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:Corbel"><br />
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.</span><span style="font-size:7.5pt;font-family:PMingLiU"><br />
<br />
</span><span style="font-size:7.5pt;font-family:Corbel">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. </span></p><p></p>
</div>


<p style="margin-top: 2.5em; margin-bottom: 1em; border-bottom: 1px solid #000"></p><pre class="k9mail">*** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a><br />*** Archive: <a href="http://www.eprints.org/tech.php">http://www.eprints.org/tech.php</a>/<br />*** EPrints community wiki: <a href="http://wiki.eprints.org">http://wiki.eprints.org</a>/<br />*** EPrints developers Forum: <a href="http://forum.eprints.org">http://forum.eprints.org</a>/<br /></pre></blockquote></div><br>
-- <br>
Sent from my Android device with K-9 Mail. Please excuse my brevity.</body></html>