[EP-tech] making SWORD 2 importers visible

Ian Stuart Ian.Stuart at ed.ac.uk
Fri Oct 11 12:27:06 BST 2013


I'm trying to write a SWORD 2 importer for EP 3.3

The [trimmed] code reads:

----- start ---------
package EPrints::Plugin::Import::RJ_Broker_3;

use strict;

use EPrints::Plugin::Import::Archive;
our @ISA = qw/ EPrints::Plugin::Import::Archive /;

sub new
{
	my( $class, %params ) = @_;

	my $self = $class->SUPER::new( %params );
warn "Foo";

     # The name to display
	$self->{name} = "SWORD 2 importer for an RJ_Broker package";

     # Who can see it, and whether we show it
	$self->{visible} = "all";
	$self->{advertise} = 1;

     # What the importer produces
	$self->{produce} = [qw( dataobj/eprint )];

     # What mime-types can trigger this importer
	$self->{accept} = [qw( application/vnd.rjbroker.1 ) ];

     # what actions to take with the data supplied
	$self->{actions} = [qw( metadata media )];

     return $self;
}
1;
----- end ---------

I know the code loads, as I see "Foo" in the Apache error log (twice)
... however I don't see the importer listed when I pull down the sword 
servicedocumet
(and yes, I've discovered that the SWORD v1.3 plugin overrides this call 
- I've removed that plugin)

------ start -------
<service xmlns="http://www.w3.org/2007/app" 
xmlns:atom="http://www.w3.org/2005/Atom" 
xmlns:sword="http://purl.org/net/sword/" 
xmlns:dcterms="http://purl.org/dc/terms/">
<workspace>
<atom:title>3.3.5-3: Manage deposits</atom:title>
<sword:version>2.0</sword:version>
<collection href="http://devel.edina.ac.uk:1202/id/contents">
<atom:title>Eprints</atom:title>
<sword:mediation>true</sword:mediation>
<accept alternate="multipart-related">application/vnd.eprints.data+xml; 
charset=utf-8</accept>
<acceptPackaging>http://eprints.org/ep2/data/2.0</acceptPackaging>
<accept alternate="multipart-related">application/zip</accept>
<accept alternate="multipart-related">application/x-gzip</accept>
<acceptPackaging>http://purl.org/net/sword/package/SimpleZip</acceptPackaging>
<accept alternate="multipart-related">
application/vnd.openxmlformats-officedocument.wordprocessingml.document
</accept>
<accept 
alternate="multipart-related">application/vnd.openxmlformats</accept>
<accept alternate="multipart-related">application/msword</accept>
<acceptPackaging>http://purl.org/net/sword/package/Binary</acceptPackaging>
<accept alternate="multipart-related">application/octet-stream</accept>
<categories fixed="yes">
<atom:category scheme="http://devel.edina.ac.uk:1202/data/eprint/type/" 
term="article"/>
<atom:category scheme="http://devel.edina.ac.uk:1202/data/eprint/type/" 
term="book_section"/>
<atom:category scheme="http://devel.edina.ac.uk:1202/data/eprint/type/" 
term="monograph"/>
<atom:category scheme="http://devel.edina.ac.uk:1202/data/eprint/type/" 
term="conference_item"/>
<atom:category scheme="http://devel.edina.ac.uk:1202/data/eprint/type/" 
term="book"/>
<atom:category scheme="http://devel.edina.ac.uk:1202/data/eprint/type/" 
term="thesis"/>
<atom:category scheme="http://devel.edina.ac.uk:1202/data/eprint/type/" 
term="patent"/>
<atom:category scheme="http://devel.edina.ac.uk:1202/data/eprint/type/" 
term="artefact"/>
<atom:category scheme="http://devel.edina.ac.uk:1202/data/eprint/type/" 
term="exhibition"/>
<atom:category scheme="http://devel.edina.ac.uk:1202/data/eprint/type/" 
term="composition"/>
<atom:category scheme="http://devel.edina.ac.uk:1202/data/eprint/type/" 
term="performance"/>
<atom:category scheme="http://devel.edina.ac.uk:1202/data/eprint/type/" 
term="image"/>
<atom:category scheme="http://devel.edina.ac.uk:1202/data/eprint/type/" 
term="video"/>
<atom:category scheme="http://devel.edina.ac.uk:1202/data/eprint/type/" 
term="audio"/>
<atom:category scheme="http://devel.edina.ac.uk:1202/data/eprint/type/" 
term="dataset"/>
<atom:category scheme="http://devel.edina.ac.uk:1202/data/eprint/type/" 
term="experiment"/>
<atom:category scheme="http://devel.edina.ac.uk:1202/data/eprint/type/" 
term="teaching_resource"/>
<atom:category scheme="http://devel.edina.ac.uk:1202/data/eprint/type/" 
term="other"/>
<atom:category 
scheme="http://devel.edina.ac.uk:1202/data/eprint/status/" term="inbox"/>
<atom:category 
scheme="http://devel.edina.ac.uk:1202/data/eprint/status/" term="buffer"/>
<atom:category 
scheme="http://devel.edina.ac.uk:1202/data/eprint/status/" term="archive"/>
<atom:category 
scheme="http://devel.edina.ac.uk:1202/data/eprint/status/" term="deletion"/>
</categories>
</collection>
</workspace>
</service>
------ end -------

Any suggestions?

-- 

Ian Stuart.
Developer: ORI, RJ-Broker, and OpenDepot.org
Bibliographics and Multimedia Service Delivery team,
EDINA,
The University of Edinburgh.

http://edina.ac.uk/

This email was sent via the University of Edinburgh.

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



More information about the Eprints-tech mailing list