EPrints Technical Mailing List Archive
See the EPrints wiki for instructions on how to join this mailing list and related information.
Message: #01516
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
[EP-tech] Difficulty in getting object retrieval working in custom storage module
- To: eprints-tech@ecs.soton.ac.uk
- Subject: [EP-tech] Difficulty in getting object retrieval working in custom storage module
- From: Simon McLeish <simon.mcleish@gmail.com>
- Date: Tue, 5 Feb 2013 12:54:06 +0000
Hi,
I'm trying to set up a custom storage module which communicates with a REST interface using LWP. I can store objects OK, and retrieve them directly (i.e. not through eprints). But when I try to retrieve an object through the EPrints interface I get the following in the log:------------------------------------------------------------------
---------------- EPrints System Error ----------------------------
------------------------------------------------------------------
Error in file retrieval: failed to get file contents
------------------------------------------------------------------
at /usr/share/eprints3/perl_lib/EPrints/Apache/Storage.pm line 261
EPrints::Apache::Storage::handler('Apache2::RequestRec=SCALAR(0x7f9a1fb053c0)') called at -e line 0
eval {...} called at -e line 0
[Tue Feb 05 12:35:20 2013] [error] [client 138.38.192.151] EPrints::abort()\n, referer: https://float.bath.ac.uk/cgi/users/home?screen=EPrint::Edit&eprintid=1&stage=files
sub retrieve
{
my( $self, $fileobj, $sourceid, $offset, $n, $f ) = @_;
my $repository = $self->{session}->get_repository;
$repository->log( "Attempting to set up user agent" ) if ($self->{debug}); # for testing
if (create_ua( $self, $fileobj))
{
$repository->log( "Attempting to access HCP " . $self->{_url}->{$fileobj} ) if ($self->{debug}); # for testing
my $ua = $self->{_ua}->{$fileobj};
my $request = new HTTP::Request('GET',$self->{_url}->{$fileobj});
my $response = $ua->request( $request,$f ); # feed the response to the callback function
$repository->log( "Have response" ) if ($self->{debug}); # for testing
if( $response->is_error )
{
$repository->log( $response->as_string );
}
return $response->is_success;
}
else
{
$repository->log("Could not define LWP user agent: aborting file save\n");
return 0;
}
}
$ua->request( $request,$f )
- Prev by Date: [EP-tech] size of tables in mysql
- Next by Date: [EP-tech] Re: Difficulty in getting object retrieval working in custom storage module
- Previous by thread: [EP-tech] size of tables in mysql
- Next by thread: [EP-tech] Re: Difficulty in getting object retrieval working in custom storage module
- Index(es):