Skip to content
Snippets Groups Projects
Commit eb85ebca authored by David Maus's avatar David Maus
Browse files

Verwende Unterverzeichnis /record

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