=pod A plugin that will add the IDs of a search result to a shelf specified by the shelfid param. Note that this is not advertised. The link is created by the shelves javascript. This was required due to chenges in the EPrints search infrastructure (Xapian searches don't have caches. =cut package EPrints::Plugin::Export::AddToShelf; use EPrints::Plugin::Export; @ISA = ( "EPrints::Plugin::Export" ); use strict; use JSON; sub new { my( $class, %opts ) = @_; my $self = $class->SUPER::new( %opts ); $self->{name} = "Add To Shelf"; $self->{accept} = [ 'list/eprint' ]; $self->{visible} = "all"; $self->{mimetype} = "application/json"; $self->{advertise} = 0; $self->{GLOBAL_ERROR} = undef; return $self; } sub output_list { my( $plugin, %opts ) = @_; my $repo = $plugin->repository; my $user = $repo->current_user; if (!$user) { return JSON::encode_json({ error => '