EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #03342


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] Re: Export plugin with views.pm features


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@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] De la part de Sebastien Francois
Envoyé : 30 juillet 2014 12:39
À : eprints-tech@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@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