Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dariah
search
Commits
a24becf9
Commit
a24becf9
authored
Sep 27, 2021
by
Gradl, Tobias
Browse files
445: Link from search results presentation to quick-search * on
respective collection (OPENED) Task-Url:
#445
parent
24079e83
Pipeline
#27075
passed with stage
in 46 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
build.gradle
View file @
a24becf9
...
...
@@ -19,8 +19,8 @@ allprojects {
}
ext
{
coreVersion
=
"6.5.4-SNAPSHOT"
gtfVersion
=
"2.3.
7
-SNAPSHOT"
processingVersion
=
"4.3.1
0
-SNAPSHOT"
gtfVersion
=
"2.3.
8
-SNAPSHOT"
processingVersion
=
"4.3.1
1
-SNAPSHOT"
colregModelVersion
=
"4.5.10-SNAPSHOT"
dariahSpVersion
=
"2.1.7-RELEASE"
...
...
search-core/src/main/java/eu/dariah/de/search/controller/search/ItemController.java
View file @
a24becf9
...
...
@@ -137,28 +137,19 @@ public class ItemController extends BaseController {
List
<
Resource
>
infos
=
ResourceHelper
.
findRecursive
(
res
,
"PrimaryInfo"
);
if
(!
infos
.
isEmpty
())
{
String
queryMessageCode
;
String
label
;
for
(
Resource
info
:
infos
)
{
if
(
info
.
getChildResources
()!=
null
)
{
// Check for available translations
for
(
Resource
c
:
info
.
getChildResources
())
{
if
(
c
.
getKey
().
equals
(
"Type"
)
&&
c
.
getValue
()!=
null
)
{
queryMessageCode
=
"~eu.dariah.de.minfba.search.view.item.presentation_metadata.primary_info_types."
+
c
.
getValue
().
toString
().
toLowerCase
();
label
=
messageSource
.
getMessage
(
queryMessageCode
,
null
,
locale
);
if
(!
label
.
equals
(
queryMessageCode
))
{
c
.
setValue
(
label
);
}
}
}
}
}
contentElements
.
put
(
"Info"
,
infos
);
contentElements
.
put
(
"Info"
,
this
.
translateTypeLabels
(
infos
,
locale
));
}
List
<
Resource
>
frames
=
ResourceHelper
.
findRecursive
(
res
,
"EmbeddedFrame"
);
if
(!
frames
.
isEmpty
())
{
contentElements
.
put
(
"Frame"
,
frames
);
}
List
<
Resource
>
secInfos
=
ResourceHelper
.
findRecursive
(
res
,
"SecondaryInfo"
);
if
(!
secInfos
.
isEmpty
())
{
model
.
addAttribute
(
"secondaryInfo"
,
this
.
translateTypeLabels
(
secInfos
,
locale
));
}
List
<
Resource
>
keywords
=
ResourceHelper
.
findRecursive
(
res
,
"Keyword"
);
if
(!
keywords
.
isEmpty
())
{
...
...
@@ -197,6 +188,26 @@ public class ItemController extends BaseController {
return
"item/view"
;
}
private
List
<
Resource
>
translateTypeLabels
(
List
<
Resource
>
infos
,
Locale
locale
)
{
String
queryMessageCode
;
String
label
;
for
(
Resource
info
:
infos
)
{
if
(
info
.
getChildResources
()!=
null
)
{
// Check for available translations
for
(
Resource
c
:
info
.
getChildResources
())
{
if
(
c
.
getKey
().
equals
(
"Type"
)
&&
c
.
getValue
()!=
null
)
{
queryMessageCode
=
"~eu.dariah.de.minfba.search.view.item.presentation_metadata.primary_info_types."
+
c
.
getValue
().
toString
().
toLowerCase
();
label
=
messageSource
.
getMessage
(
queryMessageCode
,
null
,
locale
);
if
(!
label
.
equals
(
queryMessageCode
))
{
c
.
setValue
(
label
);
}
}
}
}
}
return
infos
;
}
@PostMapping
(
value
=
"/"
)
public
String
postItem
(
@PathVariable
String
type
,
@PathVariable
String
itemId
,
@RequestParam
(
required
=
false
,
name
=
"query"
)
String
jsonQuery
,
Model
model
,
Locale
locale
,
RedirectAttributes
attributes
,
HttpServletResponse
response
)
throws
IOException
{
if
(
jsonQuery
!=
null
)
{
...
...
i18n
@
9b735064
Compare
19f2b3cf
...
9b735064
Subproject commit
19f2b3cfa0b844dff45eb23e4fa0ebb8e4858617
Subproject commit
9b73506483a4159053f603fe949ffeba464e7761
_search-commons
@
d6e325d9
Compare
48b394b5
...
d6e325d9
Subproject commit
48b394b5c9577e324192bdf751a123ff486c1ee8
Subproject commit
d6e325d9c85c3d5a7a0f62d6c1206e34e126c709
resources
@
35e2b0ec
Compare
a86cb5d2
...
35e2b0ec
Subproject commit
a86cb5d2f3e86747d08a27cf8a83bdb452e80dd2
Subproject commit
35e2b0ec1e6a1e6610243f0556bcad9c10c69577
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