Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Maximilian Görmar
uri.hab.de
Commits
eb85ebca
Commit
eb85ebca
authored
May 29, 2018
by
David Maus
Browse files
Verwende Unterverzeichnis /record
parent
7dbffe5e
Changes
6
Hide whitespace changes
Inline
Side-by-side
public/instance/proxy/opac-de-23/.htaccess
→
public/instance/proxy/opac-de-23/
record/
.htaccess
View file @
eb85ebca
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]
public/instance/proxy/opac-de-23/index.php
→
public/instance/proxy/opac-de-23/
record/
index.php
View file @
eb85ebca
<?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
)
{
...
...
src/xslt/mods2rdf.xsl
View file @
eb85ebca
...
...
@@ -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>
...
...
src/xslt/pica/auth.xsl
View file @
eb85ebca
...
...
@@ -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>
...
...
src/xslt/pica/mods.xsl
View file @
eb85ebca
...
...
@@ -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"
>
...
...
src/xslt/prune.xsl
0 → 100644
View file @
eb85ebca
<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>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment