Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
DDA
dda-wizard
Commits
550b5f90
Commit
550b5f90
authored
Aug 08, 2018
by
Gerrit Hübbers
🃏
Browse files
Improve ContentResolver for DeGruyter
parent
6470111d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gesis/dda/publishing/domain/impl/ContentResolver.java
View file @
550b5f90
...
...
@@ -319,10 +319,13 @@ public class ContentResolver {
if
(
seedUrlString
.
contains
(
"wbv.de"
)
||
seedUrlString
.
contains
(
"budrich-academic.de"
)
)
{
result
=
new
UseNthPdfOnPageStrategy
(
0
);
}
else
if
(
seedUrlString
.
contains
(
"journals.sub.uni-hamburg.de"
)
)
{
else
if
(
seedUrlString
.
contains
(
"journals.sub.uni-hamburg.de"
)
||
seedUrlString
.
contains
(
"degruyter.com"
)
)
{
// unfortunately, SUB Uni Hamburg's OJS instances report an incorrect HTML citation_pdf_url
// meta element which points not to the actual PDF bitstream, but the landing page.
// Therefore, we discard all possible (X)HTML bitstream heuristics
// DeGruyter provides in all known cases single chapter PDFs, not full PDFs. Therefore we discard
// results from degruyter.com and rely on alternative PDF sources
result
=
new
EmptySetResolvingStrategy
();
}
else
{
...
...
src/test/java/org/gesis/dda/publishing/domain/impl/ContentResolverTest.java
View file @
550b5f90
...
...
@@ -690,6 +690,17 @@ public class ContentResolverTest {
assertTrue
(
isEqual
);
}
@Test
public
void
resolveDeGruyterDoi
()
throws
MalformedURLException
,
IOException
{
String
underTest
=
"https://doi.org/10.14361/9783839437124"
;
Metadatum
metadatum
=
new
SimpleMetadatum
(
"dc.identifier.doi"
,
underTest
);
Set
<
Metadatum
>
metadata
=
ImmutableSet
.
of
(
metadatum
);
Set
<
InputStreamAndFilenameSupplier
>
suppliers
=
ContentResolver
.
resolveContentsSuppliers
(
metadata
);
assertEquals
(
0
,
suppliers
.
size
());
}
public
static
String
unrootDomainName
(
String
url
)
{
try
{
String
result
;
...
...
Write
Preview
Supports
Markdown
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