[EP-tech] epdata_to_dataobj correct syntax

George Mamalakis mamalos at eng.auth.gr
Wed Jun 3 11:17:57 BST 2015

Hi everybody,

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 


$ perldoc ~eprints/perl_lib/EPrints/Plugin/Import.pm

mentions about epdata_to_dataobj that:

$dataobj = $plugin->epdata_to_dataobj( $epdata, %opts )
         Turn $epdata into a EPrints::DataObj using the dataset argument 
         in %opts.

         Uses the "handler" object to perform the actual object creation.

         When sub-classing you must call "epdata_to_dataobj" in order to
         correctly handle the parse-only and test phases during import.

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 

my $dataobj = $self->epdata_to_dataobj( $opts{dataset}, $epdata );

Which, to my understanding, should be the other way around as far as the 
parameter order is concerned, meaning:

my $dataobj = $self->epdata_to_dataobj($epdata, $opts{dataset});

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.

Is it so, or am I losing something very fundamental here?

Thanks for your time,


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20150603/5b0721d2/attachment.html 

More information about the Eprints-tech mailing list