<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<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]-->
</head>
<body bgcolor="white" lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Hi George,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;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:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">See:
<a 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:&quot;Calibri&quot;,&quot;sans-serif&quot;;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:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">So, either way should work, but a search in GitHub:
<a href="https://github.com/eprints/eprints/search?utf8=%E2%9C%93&amp;q=epdata_to_dataobj&amp;type=Code">
https://github.com/eprints/eprints/search?utf8=%E2%9C%93&amp;q=epdata_to_dataobj&amp;type=Code</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;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:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">John<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</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 lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:windowtext">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:windowtext"> eprints-tech-bounces@ecs.soton.ac.uk
 [mailto:eprints-tech-bounces@ecs.soton.ac.uk] <b>On Behalf Of </b>George Mamalakis<br>
<b>Sent:</b> 03 June 2015 11:18<br>
<b>To:</b> eprints-tech@ecs.soton.ac.uk<br>
<b>Subject:</b> [EP-tech] epdata_to_dataobj correct syntax<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</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 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>
&quot;<br>
$dataobj = $plugin-&gt;epdata_to_dataobj( $epdata, %opts )<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Turn $epdata into a EPrints::DataObj using the dataset argument passed<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in %opts.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Uses the &quot;handler&quot; object to perform the actual object creation.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; When sub-classing you must call &quot;epdata_to_dataobj&quot; in order to<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; correctly handle the parse-only and test phases during import.<br>
&quot;<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-&gt;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-&gt;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>&nbsp;</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>&nbsp;</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>&nbsp;</o:p></pre>
<pre>phone number : &#43;30 (2310) 994379<o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
</div>
</body>
</html>