package EPrints::Plugin::Export::OAI_DARE_DC;

use Unicode::String qw( utf8 );

use EPrints::Plugin::Export::OAI_DRIVER_DC;

@ISA = ( "EPrints::Plugin::Export::OAI_DRIVER_DC" );

use strict;

# Child of OAI_DRIVER_DC, only dc:types differ

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

	my $self = $class->SUPER::new( %opts );

	$self->{name} = "Dublin Core - OAI DARE Schema";
	$self->{accept} = [ 'dataobj/eprint' ];
	$self->{visible} = "all";
	$self->{suffix} = ".xml";
	$self->{mimetype} = "text/xml";
	
	$self->{xmlns} = "http://www.openarchives.org/OAI/2.0/oai_dc/";
	$self->{schemaLocation} = "http://www.openarchives.org/OAI/2.0/oai_dc.xsd";

	return $self;
}

# Subclassed, different mapping
sub ep_to_dc_type
{
	my( $plugin, $ep_type ) = @_;
	my %types_ep_to_dc = ( #map EP types to DARE defined types
		'article' => 'Article / Letter to editor',
		'article_news' => 'Newspaper article',
		'article_period' => 'Contribution for newspaper or weekly magazine',
		'book' => 'Book (monograph)',
		'book_edit' => 'Book editorial',
		'book_review' => 'Book Review',
		'book_section' => 'Part of book or chapter of book',
		'conference_item' => 'Article in monograph or in proceedings',
		'extreport' => 'External research report',
		'inaugural_lecture' => 'Inaugural lecture',
		'intreport' => 'Internal report',
		#'referee' => 'Referee',
		'still' => 'Still image (photo, video, movie)',
		'thesis' => 'Doctoral thesis',
		#'other' => 'Other',
	);
	return $types_ep_to_dc{ $ep_type };
}

1;
