From ee2390c11d4ada473233d9fb1fe2ebe10d1d9c42 Mon Sep 17 00:00:00 2001 From: Hector Castro Date: Fri, 30 Jan 2015 11:14:08 -0600 Subject: [PATCH 08/11] Bug 13642 [ENH] Adding new features for Dublin Core metadata Changes conditional if() for include more options "dc" (opac-export.pl) --- opac/opac-export.pl | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/opac/opac-export.pl b/opac/opac-export.pl index 707392f..1d9afff 100755 --- a/opac/opac-export.pl +++ b/opac/opac-export.pl @@ -34,6 +34,13 @@ my $format=$query->param("format")||'utf8'; my $biblionumber = $query->param("bib")||0; $biblionumber = int($biblionumber); my ($marc, $error)= ('',''); +my $biblionumber = $query->param("bib"); +my $recommendation = $query->param("recommendation"); +my $formats = $query->param("formats"); +my $qualifier = $query->param("qualifier"); +my $root_element = $query->param("root_element"); +my $xsischemalocation = $query->param("xsischemalocation"); +my $resource_url = $query->url(-base => 1) . '/cgi-bin/koha/opac-detail.pl?biblionumber=' . $biblionumber; $marc = GetMarcBiblio($biblionumber, 1) if $biblionumber; if(!$marc) { @@ -61,8 +68,28 @@ elsif ($format =~ /bibtex/) { $format = 'bibtex'; } elsif ($format =~ /dc/) { - ($error,$marc) = marc2dcxml($marc,1); - $format = "dublin-core.xml"; + SWITCH: + for ($recommendation) { + if (/^simple-dc-rdf/) { + ($error,$marc) = marc2dcxml($recommendation, $marc, 0, + 1, undef, undef, $resource_url , $formats); + $format = "dublin-core." . $formats; + last SWITCH; } + if (/^dc-rdf/) { + ($error,$marc) = marc2dcxml($recommendation, $marc, 1, + 1, undef, undef, $resource_url, $formats); + $format = "dublin-core." . $formats; + last SWITCH; } + if (/^dc-xml/) { + ($error,$marc) = marc2dcxml($recommendation, $marc, $qualifier, + 1, $root_element, $xsischemalocation, undef, undef); + $format = "dublin-core.xml"; + last SWITCH; } + if (/^oai-dc/) { + ($error,$marc) = marc2dcxml($recommendation, $marc); + $format = "dublin-core.xml"; + last SWITCH; } + } } elsif ($format =~ /marc8/) { ($error,$marc) = changeEncoding($marc,"MARC","MARC21","MARC-8"); -- 1.7.10.4