<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Thanks John!<br>
<br>
On 03/06/2015 05:18 μμ, John Salter wrote:<br>
</div>
<blockquote
cite="mid:EMEW3|212f07350ffb6f4c90400b5653bea6a4r52FJh14eprints-tech-bounces|ecs.soton.ac.uk|AMSPR03MB360832E8E92507E10067B0BC4B40@AMSPR03MB360.eurprd03.prod.outlook.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi
George,<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">It
looks like at some point the order was changed, but in a
backwards –compatible way.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">See:
<a moz-do-not-send="true"
href="https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/Plugin/Import.pm#L299-L302">https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/Plugin/Import.pm#L299-L302</a><o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">-
the method checks which parameter passed in is the DataSet
and acts accordingly.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">So,
either way should work, but a search in GitHub:
<a moz-do-not-send="true"
href="https://github.com/eprints/eprints/search?utf8=%E2%9C%93&q=epdata_to_dataobj&type=Code">https://github.com/eprints/eprints/search?utf8=%E2%9C%93&q=epdata_to_dataobj&type=Code</a><o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">it
looks like dataset, data is the more common way.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">John<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF
1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext"
lang="EN-US">From:</span></b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext"
lang="EN-US"> <a class="moz-txt-link-abbreviated" href="mailto:eprints-tech-bounces@ecs.soton.ac.uk">eprints-tech-bounces@ecs.soton.ac.uk</a>
[<a class="moz-txt-link-freetext" href="mailto:eprints-tech-bounces@ecs.soton.ac.uk">mailto:eprints-tech-bounces@ecs.soton.ac.uk</a>] <b>On
Behalf Of </b>George Mamalakis<br>
<b>Sent:</b> 03 June 2015 11:18<br>
<b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:eprints-tech@ecs.soton.ac.uk">eprints-tech@ecs.soton.ac.uk</a><br>
<b>Subject:</b> [EP-tech] epdata_to_dataobj correct
syntax<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi everybody,<br>
<br>
I am trying to understand how the EPrints' DSpace.pm import
plugin exactly works and from what I've read from the API and
the plugin's code, I got confused as to how
epdata_to_dataobj() function should be called. To be honest,
the same question holds for the import-plugin-example as well
(<a moz-do-not-send="true"
href="http://wiki.eprints.org/w/Contribute:_Plugins/ImportPluginsCSV#input_fh">http://wiki.eprints.org/w/Contribute:_Plugins/ImportPluginsCSV#input_fh</a>).<br>
<br>
Running:<br>
<br>
$ perldoc ~eprints/perl_lib/EPrints/Plugin/Import.pm<br>
<br>
mentions about epdata_to_dataobj that:<br>
<br>
"<br>
$dataobj = $plugin->epdata_to_dataobj( $epdata, %opts )<br>
Turn $epdata into a EPrints::DataObj using the dataset
argument passed<br>
in %opts.<br>
<br>
Uses the "handler" object to perform the actual object
creation.<br>
<br>
When sub-classing you must call "epdata_to_dataobj" in
order to<br>
correctly handle the parse-only and test phases during
import.<br>
"<br>
<br>
And this is indeed how the function is coded in
~eprints/perl_lib/EPrints/Plugin/Import.pm. On the other hand,
the online example as well as the DSpace plugin call the same
function like this:<br>
<br>
my $dataobj = $self->epdata_to_dataobj( $opts{dataset},
$epdata );<br>
<br>
Which, to my understanding, should be the other way around as
far as the parameter order is concerned, meaning:<br>
<br>
my $dataobj = $self->epdata_to_dataobj($epdata,
$opts{dataset});<br>
<br>
The truth is that my perl is very rusty, but from a first
glance I think that the call to epdata_to_dataobj() function
is in both codes (plugin example and DSpace plugin) wrong.<br>
<br>
Is it so, or am I losing something very fundamental here?<br>
<br>
Thanks for your time,<br>
<br>
George.<br>
<br>
<o:p></o:p></p>
<pre>-- <o:p></o:p></pre>
<pre>George Mamalakis<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>IT and Security Officer, <o:p></o:p></pre>
<pre>Electrical and Computer Engineer (Aristotle Univ. of Thessaloniki),<o:p></o:p></pre>
<pre>PhD (Aristotle Univ. of Thessaloniki),<o:p></o:p></pre>
<pre>MSc (Imperial College of London)<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>School of Electrical and Computer Engineering<o:p></o:p></pre>
<pre>Aristotle University of Thessaloniki<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>phone number : +30 (2310) 994379<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">*** Options: <a class="moz-txt-link-freetext" href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a>
*** Archive: <a class="moz-txt-link-freetext" href="http://www.eprints.org/tech.php/">http://www.eprints.org/tech.php/</a>
*** EPrints community wiki: <a class="moz-txt-link-freetext" href="http://wiki.eprints.org/">http://wiki.eprints.org/</a>
*** EPrints developers Forum: <a class="moz-txt-link-freetext" href="http://forum.eprints.org/">http://forum.eprints.org/</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
George Mamalakis
IT and Security Officer,
Electrical and Computer Engineer (Aristotle Univ. of Thessaloniki),
PhD (Aristotle Univ. of Thessaloniki),
MSc (Imperial College of London)
School of Electrical and Computer Engineering
Aristotle University of Thessaloniki
phone number : +30 (2310) 994379
</pre>
</body>
</html>