[EP-tech] Re: Export plugin with views.pm features
Gaston.Fournier at etsmtl.ca
Gaston.Fournier at etsmtl.ca
Wed Jul 30 20:25:15 BST 2014
That's a good starting point and it is working well once you have added the following instructions just at the beginning of the cgi :
#!/usr/bin/perl
use strict;
use warnings;
use EPrints;
my $eprints = EPrints->new;
my $repo = $eprints->current_repository;
exit( 0 ) unless defined $repo;
But the big question is : can we get an output with views.pm features (like INCLUDE) without rewriting views.pm? Is there an export plugin with such features (or close to)?
At the end, the idea is to have a script, which the syntax is similar to the ones we use for harvesting, like : http://espace-test.etsmtl.ca/cgi/oai2?verb=ListRecords&metadataPrefix=oai_dc where
metadataPrefix calls the export plugin.
GF
De : eprints-tech-bounces at ecs.soton.ac.uk [mailto:eprints-tech-bounces at ecs.soton.ac.uk] De la part de Sebastien Francois
Envoyé : 30 juillet 2014 12:39
À : eprints-tech at ecs.soton.ac.uk
Objet : [EP-tech] Re: Export plugin with views.pm features
Your example can be done via a search:
http://demoprints.eprints.org/cgi/search/archive/advanced?screen=Search&dataset=archive&type=article&refereed=TRUE&satisfyall=ALL&order=-date%2Fcreators_name%2Ftitle&_action_search=Search
Searches can be exported (like any list of objects).
Otherwise you can write your own CGI (if your conditions are more complex) - something like (adapt to your needs):
my $list = $repo->dataset( 'archive' )->search(
filters => [
{ meta_fields => [qw/ type /], value => 'article', match => 'EX', },
{ meta_fields => [qw/ refereed /], value => 'TRUE', match => 'EX', },
] );
binmode( STDOUT, ":utf8" );
$list->export( 'XML', fh => *STDOUT );
Seb.
On 30/07/14 17:01, Gaston.Fournier at etsmtl.ca<mailto:Gaston.Fournier at etsmtl.ca> wrote:
Here is an example of the Boolean expressions used in a cgi script to generate a subset of eprints for the output :
if ( $eprint->get_value( "type" ) eq "article" && $eprint->get_value( "refereed" ) eq "TRUE" )
GF
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20140730/4d03bd8b/attachment.html
More information about the Eprints-tech
mailing list