Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Andrey Lugovskiy
Taxonomy Tools
Commits
fa0c6b78
Commit
fa0c6b78
authored
Mar 13, 2017
by
Andrey Lugovskiy
Browse files
end
parent
bf2e677e
Pipeline
#492
passed with stage
in 49 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
taxonomychecker-cli/taxonomychecker-web/src/main/java/org/genesys2/gringlobal/taxonomy/controller/ApplicationController.java
View file @
fa0c6b78
...
...
@@ -43,6 +43,7 @@ public class ApplicationController {
model
.
addAttribute
(
"result"
,
processService
.
process
(
file
,
separator
,
quoteChar
,
escapeChar
,
coyFromExcel
,
toCurrentTaxa
).
toString
());
model
.
addAttribute
(
"newLineSymbol"
,
"\n"
);
model
.
addAttribute
(
"symbolQuote"
,
"\""
);
model
.
addAttribute
(
"separator"
,
separator
);
return
"result"
;
}
}
taxonomychecker-cli/taxonomychecker-web/src/main/java/org/genesys2/gringlobal/taxonomy/service/impl/ProcessServiceImpl.java
View file @
fa0c6b78
...
...
@@ -44,8 +44,8 @@ public class ProcessServiceImpl implements ProcessService {
@Override
public
StringWriter
process
(
MultipartFile
file
,
Character
separator
,
Character
quoteChar
,
Character
escapeChar
,
String
coyFromExcel
,
Boolean
toCurrentTaxa
)
throws
ParseException
,
IOException
,
TaxonomyException
{
LOG
.
info
(
"Start process with file: '{}', separator: '{}',
coyFromExcel: '{}',
toCurrentTaxa: '{}'"
,
file
.
getOriginalFilename
(),
separator
,
coyFromExcel
,
toCurrentTaxa
);
LOG
.
info
(
"Start process with file: '{}', separator: '{}', toCurrentTaxa: '{}'"
,
file
.
getOriginalFilename
(),
separator
,
toCurrentTaxa
);
readDatabase
(
applicationProperties
.
getDatabaseFolderPath
());
return
run
(
file
.
getInputStream
(),
separator
,
quoteChar
,
escapeChar
,
coyFromExcel
,
toCurrentTaxa
);
}
...
...
@@ -80,10 +80,18 @@ public class ProcessServiceImpl implements ProcessService {
taxonomyChecker
.
setTaxonomyDatabase
(
taxonomyDatabase
);
LOG
.
info
(
"Running the validation against {}"
,
taxonomyDatabase
);
try
(
CSVReader
reader
=
new
CSVReader
(
new
InputStreamReader
(
inputStream
,
"UTF-8"
),
separator
,
Reader
reader
;
if
(
coyFromExcel
!=
null
&&
!
coyFromExcel
.
isEmpty
()){
reader
=
new
StringReader
(
coyFromExcel
);
}
else
{
reader
=
new
InputStreamReader
(
inputStream
,
"UTF-8"
);
}
try
(
CSVReader
csvReader
=
new
CSVReader
(
reader
,
separator
,
quoteChar
,
escapeChar
,
0
,
false
,
true
,
false
))
{
String
[]
headers
=
r
eader
.
readNext
();
String
[]
headers
=
csvR
eader
.
readNext
();
LOG
.
debug
(
"Input CSV headers: {}"
,
Arrays
.
toString
(
headers
));
{
...
...
@@ -181,7 +189,7 @@ public class ProcessServiceImpl implements ProcessService {
String
[]
sourceLine
;
while
((
sourceLine
=
r
eader
.
readNext
())
!=
null
)
{
while
((
sourceLine
=
csvR
eader
.
readNext
())
!=
null
)
{
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"\n\n"
);
...
...
taxonomychecker-cli/taxonomychecker-web/src/main/webapp/WEB-INF/pages/result.jsp
View file @
fa0c6b78
<%@ taglib
prefix=
"spring"
uri=
"http://www.springframework.org/tags"
%>
<%@ taglib
prefix=
"spring"
uri=
"http://www.springframework.org/tags"
%>
<%@ taglib
prefix=
"c"
uri=
"http://java.sun.com/jsp/jstl/core"
%>
<%@ page
contentType=
"text/html;charset=UTF-8"
language=
"java"
%>
<%@ taglib
uri=
"http://java.sun.com/jsp/jstl/functions"
prefix=
"fn"
%>
...
...
@@ -7,17 +7,21 @@
<head>
<title><spring:message
code=
"label.title"
/></title>
<style>
.div1
{
display
:
inline
;
.div1
{
display
:
inline
;
min-width
:
90px
;
width
:
90px
;}
width
:
90px
;
}
</style>
</head>
<body>
<c:forEach
items=
'
${
fn:
split
(
result
,
newLineSymbol
)
}
'
var=
"row"
>
<div
class=
""
>
<c:forEach
items=
'
${
fn:
split
(
row
,
","
)
}
'
var=
"element"
>
<div
class=
"div1"
><c:out
value=
"
${
fn:
replace
(
element
,
symbolQuote
,
''
)
}
"
/></div>
</c:forEach>
<c:forEach
items=
"
${
fn:
split
(
fn:
replace
(
row
,
','
,
' , '
),
','
)
}
"
var=
"element"
>
<div
class=
"div1"
>
<c:out
value=
"
${
element
}
"
/>
</div>
</c:forEach>
;
</div>
</c:forEach>
</body>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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