Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
DARIAH-DE
TextGridRep Portal
Commits
422eb50e
Commit
422eb50e
authored
Jun 05, 2020
by
Ubbo Veentjer
Browse files
let jsp do the npe checking. closes
#57
parent
1b889d4b
Pipeline
#138427
passed with stages
in 9 minutes and 43 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/info/textgrid/rep/search/SearchController.java
View file @
422eb50e
...
@@ -89,7 +89,7 @@ public class SearchController {
...
@@ -89,7 +89,7 @@ public class SearchController {
model
.
addAttribute
(
"mode"
,
mode
);
model
.
addAttribute
(
"mode"
,
mode
);
model
.
addAttribute
(
"results"
,
res
.
getResult
());
model
.
addAttribute
(
"results"
,
res
.
getResult
());
model
.
addAttribute
(
"facet
s
"
,
res
.
getFacetResponse
()
.
getFacetGroup
()
);
model
.
addAttribute
(
"facet
Response
"
,
res
.
getFacetResponse
());
model
.
addAttribute
(
"query"
,
HtmlUtils
.
htmlEscape
(
query
));
model
.
addAttribute
(
"query"
,
HtmlUtils
.
htmlEscape
(
query
));
model
.
addAttribute
(
"order"
,
order
);
model
.
addAttribute
(
"order"
,
order
);
model
.
addAttribute
(
"start"
,
start
);
model
.
addAttribute
(
"start"
,
start
);
...
...
src/main/webapp/WEB-INF/jsp/search.jsp
View file @
422eb50e
...
@@ -64,7 +64,7 @@
...
@@ -64,7 +64,7 @@
</section>
</section>
</c:if>
</c:if>
<c:forEach
items=
"
${
facet
s
}
"
var=
"facetGroup"
>
<c:forEach
items=
"
${
facet
Response
.
facetGroup
}
"
var=
"facetGroup"
>
<c:if
test=
"
${
facetGroup
.
facet
.
size
()
!=
0
}
"
>
<c:if
test=
"
${
facetGroup
.
facet
.
size
()
!=
0
}
"
>
<section
class=
"tgrep sidebar_panel"
>
<section
class=
"tgrep sidebar_panel"
>
<h3
class=
"tgrep sidebar_subheading"
>
${i18n[facetGroup.name]}
</h3>
<h3
class=
"tgrep sidebar_subheading"
>
${i18n[facetGroup.name]}
</h3>
...
...
src/test/java/info/textgrid/rep/search/SearchControllerTest.java
View file @
422eb50e
...
@@ -130,6 +130,17 @@ public class SearchControllerTest {
...
@@ -130,6 +130,17 @@ public class SearchControllerTest {
.
andExpect
(
model
().
attribute
(
"filter"
,
hasSize
(
2
)));
.
andExpect
(
model
().
attribute
(
"filter"
,
hasSize
(
2
)));
}
}
// #57 - NPE when no facetresponse set (empty result)
@Test
public
void
noResults
()
throws
Exception
{
mvc
.
perform
(
MockMvcRequestBuilders
.
get
(
"/search"
)
.
queryParam
(
"query"
,
"(genre:\"roman\") AND (work.dateOfCreation.date:\"18??\") AND format:\"text/xml\""
)
.
accept
(
MediaType
.
TEXT_HTML
))
.
andExpect
(
status
().
isOk
())
.
andExpect
(
view
().
name
(
"search"
))
.
andExpect
(
forwardedUrl
(
"/WEB-INF/jsp/search.jsp"
));
}
// TODO: test gallery image view: changing filters, view or limit should persist the
// TODO: test gallery image view: changing filters, view or limit should persist the
// already set properties and not drop them
// already set properties and not drop them
...
...
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