|
Lines 65-76
respecively MARC21slim2OAIDC.xsl for MARC21 and MARC21slim2OAIDC.xsl for
Link Here
|
| 65 |
UNIMARC. |
65 |
UNIMARC. |
| 66 |
|
66 |
|
| 67 |
In extended mode, it's possible to parameter other format than marcxml or |
67 |
In extended mode, it's possible to parameter other format than marcxml or |
| 68 |
Dublin Core. A new syspref OAI-PMH:ConfFile specify a YAML configuration file |
68 |
Dublin Core. Syspref OAI-PMH:ConfFile specify a YAML configuration file which |
| 69 |
which list available metadata formats and XSL file used to create them from |
69 |
list available metadata formats and XSL file used to create them from marcxml |
| 70 |
marcxml records. If this syspref isn't set, Koha OAI server works in simple |
70 |
records. If this syspref isn't set, Koha OAI server works in simple mode. |
| 71 |
mode. A configuration file koha-oai.conf can look like that: |
71 |
|
|
|
72 |
Extended mode is required when you want: (a) to return item info |
| 73 |
(C<include_items> parameter), (b) to provide other metadata format than |
| 74 |
oai_dc/marcxml (C<format> parameter), (c) to provide a localized OAI server |
| 75 |
view (C<xslt> parameter). |
| 76 |
|
| 77 |
A configuration file koha-oai.conf can look like that: |
| 72 |
|
78 |
|
| 73 |
--- |
79 |
--- |
|
|
80 |
xslt: /usr/local/koha/xslt/serverview.xslt |
| 74 |
format: |
81 |
format: |
| 75 |
vs: |
82 |
vs: |
| 76 |
metadataPrefix: vs |
83 |
metadataPrefix: vs |
|
Lines 103-110
sub new {
Link Here
|
| 103 |
$self->{ koha_stylesheet } = { }; # Build when needed |
110 |
$self->{ koha_stylesheet } = { }; # Build when needed |
| 104 |
|
111 |
|
| 105 |
# Load configuration file if defined in OAI-PMH:ConfFile syspref |
112 |
# Load configuration file if defined in OAI-PMH:ConfFile syspref |
| 106 |
if ( my $file = C4::Context->preference("OAI-PMH:ConfFile") ) { |
113 |
my $conf = C4::Context->preference("OAI-PMH:ConfFile"); |
| 107 |
$self->{ conf } = LoadFile( $file ); |
114 |
if ( $conf ) { |
|
|
115 |
$self->{ conf } = $conf = LoadFile( $conf ); |
| 108 |
my @formats = keys %{ $self->{conf}->{format} }; |
116 |
my @formats = keys %{ $self->{conf}->{format} }; |
| 109 |
$self->{ koha_metadata_format } = \@formats; |
117 |
$self->{ koha_metadata_format } = \@formats; |
| 110 |
} |
118 |
} |
|
Lines 136-142
sub new {
Link Here
|
| 136 |
} |
144 |
} |
| 137 |
|
145 |
|
| 138 |
$response->set_handler( XML::SAX::Writer->new( Output => *STDOUT ) ); |
146 |
$response->set_handler( XML::SAX::Writer->new( Output => *STDOUT ) ); |
| 139 |
$response->xslt( "/opac-tmpl/xslt/OAI.xslt" ); |
147 |
|
|
|
148 |
$response->xslt( |
| 149 |
$conf && $conf->{xslt} |
| 150 |
? $conf->{xslt} |
| 151 |
: "/opac-tmpl/bootstrap/css/OAI.xslt" |
| 152 |
); |
| 153 |
|
| 140 |
$response->generate; |
154 |
$response->generate; |
| 141 |
|
155 |
|
| 142 |
bless $self, $class; |
156 |
bless $self, $class; |