Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
dfaf8482
Commit
dfaf8482
authored
Jun 18, 2021
by
Piotr Gawron
Browse files
handle project without top map
parent
9ce0700f
Pipeline
#43279
passed with stage
in 18 minutes and 3 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
rest-api/src/main/java/lcsb/mapviewer/api/projects/models/ModelRestImpl.java
View file @
dfaf8482
...
...
@@ -113,15 +113,17 @@ public class ModelRestImpl extends BaseRestImpl {
private
List
<
Map
<
String
,
Object
>>
createData
(
Project
project
)
throws
QueryException
{
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<>();
Collection
<
ModelData
>
originalModels
=
getModelService
().
getModelsByProjectId
(
project
.
getProjectId
());
ModelData
topModel
=
project
.
getTopModel
().
getModelData
();
List
<
ModelData
>
models
=
new
ArrayList
<>();
for
(
ModelData
model:
originalModels
)
{
if
(!
Objects
.
equals
(
model
.
getId
(),
topModel
.
getId
()))
{
models
.
add
(
model
);
if
(
project
.
getTopModel
()
!=
null
)
{
ModelData
topModel
=
project
.
getTopModel
().
getModelData
();
for
(
ModelData
model
:
originalModels
)
{
if
(!
Objects
.
equals
(
model
.
getId
(),
topModel
.
getId
()))
{
models
.
add
(
model
);
}
}
result
.
add
(
getModel
(
topModel
));
}
models
.
sort
(
ModelData
.
ID_COMPARATOR
);
result
.
add
(
getModel
(
topModel
));
for
(
ModelData
model2
:
models
)
{
result
.
add
(
getModel
(
model2
));
}
...
...
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