Commit eb85ebca authored by David Maus's avatar David Maus
Browse files

Verwende Unterverzeichnis /record

parent 7dbffe5e
RewriteEngine On
RewriteBase /instance/proxy/opac-de-23/
RewriteBase /instance/proxy/opac-de-23/record
RewriteRule ^([0-9]+[0-9X](\.[a-z]+)?)$ /instance/proxy/opac-de-23/index.php/$1 [END]
RewriteRule ^([0-9]+[0-9X](\.[a-z]+)?)$ /instance/proxy/opac-de-23/record/index.php/$1 [END]
<?php
require_once __DIR__ . '/../../../../vendor/autoload.php';
require_once __DIR__ . '/../../../../../vendor/autoload.php';
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
......@@ -13,9 +13,9 @@ use HAB\Pica\Reader\PicaNormReader;
use HAB\Pica\Writer\PicaXmlWriter;
define('PSI_TEMPLATE', 'http://opac.lbs-braunschweig.gbv.de/DB=2/PLAIN=Y/CHARSET=UTF8/PLAINTTLCHARSET=UTF8/PPN?PPN=%s');
define('PICA_TEMPLATE', 'http://uri.hab.de/instance/proxy/opac-de-23/%s.xml');
define('MODS_TEMPLATE', 'http://uri.hab.de/instance/proxy/opac-de-23/%s.mods');
define('RDF_TEMPLATE', 'http://uri.hab.de/instance/proxy/opac-de-23/%s.rdf');
define('PICA_TEMPLATE', 'http://uri.hab.de/instance/proxy/opac-de-23/record/%s.xml');
define('MODS_TEMPLATE', 'http://uri.hab.de/instance/proxy/opac-de-23/record/%s.mods');
define('RDF_TEMPLATE', 'http://uri.hab.de/instance/proxy/opac-de-23/record/%s.rdf');
function terminate (Request $request, Response $response) {
$response->prepare($request);
......@@ -85,11 +85,11 @@ switch ($format) {
if ($type[0] === 'T') {
$response = new Response('<h1>406 Not Acceptable</h1>', 406, array('Content-Type' => 'text/html'));
} else {
$templateUri = __DIR__ . '/../../../../src/xslt/pica/mods.xsl';
$templateUri = __DIR__ . '/../../../../../src/xslt/pica/mods.xsl';
$sourceUri = sprintf(PICA_TEMPLATE, $ident);
$content = transform($sourceUri, $templateUri);
if ($content) {
$response = new Response($content, 200, array('Content-Type' => 'application/mods+xml'));
$response = new Response($content, 200, array('Content-Type' => 'application/xml'));
break;
}
}
......@@ -100,7 +100,7 @@ switch ($format) {
if ($type[0] === 'T') {
$response = new Response('<h1>406 Not Acceptable</h1>', 406, array('Content-Type' => 'text/html'));
} else {
$templateUri = __DIR__ . '/../../../../src/xslt/mods2dc.xsl';
$templateUri = __DIR__ . '/../../../../../src/xslt/mods2dc.xsl';
$sourceUri = sprintf(MODS_TEMPLATE, $ident);
$content = transform($sourceUri, $templateUri);
if ($content) {
......@@ -113,7 +113,7 @@ switch ($format) {
case 'rdf':
$type = (string)$record->getFirstMatchingField('002@/00')->getNthSubfield(0, '0');
if ($type[0] === 'T') {
$templateUri = __DIR__ . '/../../../../src/xslt/pica/auth.xsl';
$templateUri = __DIR__ . '/../../../../../src/xslt/pica/auth.xsl';
$sourceUri = sprintf(PICA_TEMPLATE, $ident);
$content = transform($sourceUri, $templateUri);
if ($content) {
......@@ -121,7 +121,7 @@ switch ($format) {
break;
}
} else {
$templateUri = __DIR__ . '/../../../../src/xslt/mods2rdf.xsl';
$templateUri = __DIR__ . '/../../../../../src/xslt/mods2rdf.xsl';
$sourceUri = sprintf(MODS_TEMPLATE, $ident);
$content = transform($sourceUri, $templateUri);
if ($content) {
......
......@@ -9,7 +9,7 @@
xmlns:mods="http://www.loc.gov/mods/v3"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="proxyBaseUrl">http://uri.hab.de/instance/proxy/opac-de-23/</xsl:variable>
<xsl:variable name="proxyBaseUrl">http://uri.hab.de/instance/proxy/opac-de-23/record/</xsl:variable>
<xsl:template match="mods:mods">
<rdf:RDF>
......
......@@ -11,7 +11,7 @@
<xsl:template match="pica:record[starts-with(pica:datafield[@tag = '002@']/pica:subfield[@code = '0'], 'Tp')]">
<rdf:RDF>
<foaf:Person rdf:about="http://uri.hab.de/instance/proxy/opac-de-23/{pica:datafield[@tag = '003@']/pica:subfield[@code = '0']}">
<foaf:Person rdf:about="http://uri.hab.de/instance/proxy/opac-de-23/record/{pica:datafield[@tag = '003@']/pica:subfield[@code = '0']}">
<xsl:apply-templates/>
<xsl:call-template name="foaf:Person">
<xsl:with-param name="nameField" select="pica:datafield[@tag = '028A']"/>
......@@ -22,7 +22,7 @@
<xsl:template match="pica:record[starts-with(pica:datafield[@tag = '002@']/pica:subfield[@code = '0'], 'Tb')]">
<rdf:RDF>
<foaf:Person rdf:about="http://uri.hab.de/instance/proxy/opac-de-23/{pica:datafield[@tag = '003@']/pica:subfield[@code = '0']}">
<foaf:Person rdf:about="http://uri.hab.de/instance/proxy/opac-de-23/record/{pica:datafield[@tag = '003@']/pica:subfield[@code = '0']}">
<xsl:apply-templates/>
<xsl:call-template name="foaf:Organization">
<xsl:with-param name="nameField" select="pica:datafield[@tag = '028A']"/>
......@@ -34,7 +34,7 @@
<xsl:template match="pica:record">
<xsl:variable name="recordType" select="substring(pica:datafield[@tag = '002@']/pica:subfield[@code = '0'], 2, 1)"/>
<rdf:RDF>
<skos:Concept rdf:about="http://uri.hab.de/instance/proxy/opac-de-23/{pica:datafield[@tag = '003@']/pica:subfield[@code = '0']}">
<skos:Concept rdf:about="http://uri.hab.de/instance/proxy/opac-de-23/record/{pica:datafield[@tag = '003@']/pica:subfield[@code = '0']}">
<xsl:apply-templates/>
</skos:Concept>
</rdf:RDF>
......
......@@ -7,7 +7,7 @@
xmlns:skos="http://www.w3.org/2004/02/skos/core#"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="proxyBaseUrl">http://uri.hab.de/instance/proxy/opac-de-23/</xsl:variable>
<xsl:variable name="proxyBaseUrl">http://uri.hab.de/instance/proxy/opac-de-23/record/</xsl:variable>
<xsl:template match="pica:record">
......
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="*[normalize-space() = '']"/>
</xsl:transform>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment