Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
11936eac
Commit
11936eac
authored
Jul 25, 2019
by
Piotr Gawron
Browse files
information about deprecated columns is available for overlays with source
parent
0a7b2d9d
Changes
2
Hide whitespace changes
Inline
Side-by-side
rest-api/src/main/java/lcsb/mapviewer/api/projects/overlays/OverlayRestImpl.java
View file @
11936eac
...
...
@@ -108,7 +108,6 @@ public class OverlayRestImpl extends BaseRestImpl {
for
(
ColorSchemaColumn
column
:
new
ColorSchemaReader
().
getDeprecatedColumns
(
overlay
))
{
result
.
add
(
column
.
name
());
}
logger
.
debug
(
result
);
return
result
;
}
catch
(
IOException
|
InvalidColorSchemaException
e
)
{
throw
new
InvalidStateException
(
e
);
...
...
service/src/main/java/lcsb/mapviewer/services/utils/ColorSchemaReader.java
View file @
11936eac
...
...
@@ -810,25 +810,27 @@ public class ColorSchemaReader {
public
List
<
ColorSchemaColumn
>
getDeprecatedColumns
(
Layout
overlay
)
throws
IOException
,
InvalidColorSchemaException
{
List
<
ColorSchemaColumn
>
result
=
new
ArrayList
<>();
BufferedReader
br
=
new
BufferedReader
(
new
InputStreamReader
(
new
ByteArrayInputStream
(
overlay
.
getInputData
().
getFileContent
())));
if
(
overlay
.
getInputData
()
!=
null
)
{
BufferedReader
br
=
new
BufferedReader
(
new
InputStreamReader
(
new
ByteArrayInputStream
(
overlay
.
getInputData
().
getFileContent
())));
String
line
=
br
.
readLine
();
while
(
line
!=
null
&&
line
.
startsWith
(
"#"
))
{
line
=
br
.
readLine
();
}
String
[]
columns
=
line
.
split
(
"\t"
);
String
line
=
br
.
readLine
();
while
(
line
!=
null
&&
line
.
startsWith
(
"#"
))
{
line
=
br
.
readLine
();
}
String
[]
columns
=
line
.
split
(
"\t"
);
Map
<
ColorSchemaColumn
,
Integer
>
schemaColumns
=
new
HashMap
<>();
parseColumns
(
columns
,
schemaColumns
,
ColorSchemaType
.
GENERIC
);
for
(
ColorSchemaColumn
column
:
schemaColumns
.
keySet
())
{
try
{
Field
f
=
ColorSchemaColumn
.
class
.
getField
(
column
.
name
());
if
(
column
.
getDepractedColumnName
()
!=
null
||
f
.
isAnnotationPresent
(
Deprecated
.
class
))
{
result
.
add
(
column
);
Map
<
ColorSchemaColumn
,
Integer
>
schemaColumns
=
new
HashMap
<>();
parseColumns
(
columns
,
schemaColumns
,
ColorSchemaType
.
GENERIC
);
for
(
ColorSchemaColumn
column
:
schemaColumns
.
keySet
())
{
try
{
Field
f
=
ColorSchemaColumn
.
class
.
getField
(
column
.
name
());
if
(
column
.
getDepractedColumnName
()
!=
null
||
f
.
isAnnotationPresent
(
Deprecated
.
class
))
{
result
.
add
(
column
);
}
}
catch
(
NoSuchFieldException
|
SecurityException
e
)
{
throw
new
InvalidStateException
(
e
);
}
}
catch
(
NoSuchFieldException
|
SecurityException
e
)
{
throw
new
InvalidStateException
(
e
);
}
}
return
result
;
...
...
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