Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
minerva
core
Commits
066b615b
Commit
066b615b
authored
7 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
api returns publication count
parent
76ab7341
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!5
Frontend refactor
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rest-api/src/main/java/lcsb/mapviewer/api/project/ModelMetaData.java
+53
-1
53 additions, 1 deletion
...c/main/java/lcsb/mapviewer/api/project/ModelMetaData.java
with
53 additions
and
1 deletion
rest-api/src/main/java/lcsb/mapviewer/api/project/ModelMetaData.java
+
53
−
1
View file @
066b615b
...
...
@@ -3,15 +3,21 @@ package lcsb.mapviewer.api.project;
import
java.awt.geom.Point2D
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
import
org.primefaces.model.map.LatLng
;
import
lcsb.mapviewer.common.Configuration
;
import
lcsb.mapviewer.model.map.MiriamData
;
import
lcsb.mapviewer.model.map.MiriamType
;
import
lcsb.mapviewer.model.map.layout.Layout
;
import
lcsb.mapviewer.model.map.model.Model
;
import
lcsb.mapviewer.model.map.model.ModelData
;
import
lcsb.mapviewer.model.map.model.ModelSubmodelConnection
;
import
lcsb.mapviewer.model.map.reaction.Reaction
;
import
lcsb.mapviewer.model.map.species.Element
;
import
lcsb.mapviewer.services.utils.gmap.CoordinationConverter
;
import
lcsb.mapviewer.services.view.LayoutView
;
import
lcsb.mapviewer.services.view.LayoutViewFactory
;
...
...
@@ -35,6 +41,8 @@ public class ModelMetaData implements Serializable {
private
Integer
idObject
;
private
Integer
publicationCount
;
/**
* Size in pixels of the single square tile (small image used for graphical
* representation).
...
...
@@ -110,6 +118,32 @@ public class ModelMetaData implements Serializable {
}
}
this
.
setSubmodels
(
submodels
);
Set
<
MiriamData
>
publications
=
new
HashSet
<>();
List
<
ModelData
>
models
=
new
ArrayList
<>();
for
(
ModelSubmodelConnection
connection
:
model
.
getSubmodels
())
{
models
.
add
(
connection
.
getSubmodel
());
}
models
.
add
(
model
);
for
(
ModelData
modelData
:
models
)
{
for
(
Element
element
:
modelData
.
getElements
())
{
for
(
MiriamData
md
:
element
.
getMiriamData
())
{
if
(
md
.
getDataType
().
equals
(
MiriamType
.
PUBMED
))
{
publications
.
add
(
md
);
}
}
}
for
(
Reaction
reaction
:
modelData
.
getReactions
())
{
for
(
MiriamData
md
:
reaction
.
getMiriamData
())
{
if
(
md
.
getDataType
().
equals
(
MiriamType
.
PUBMED
))
{
publications
.
add
(
md
);
}
}
}
}
this
.
setPublicationCount
(
publications
.
size
());
}
protected
ModelMetaData
()
{
...
...
@@ -328,10 +362,28 @@ public class ModelMetaData implements Serializable {
}
/**
* @param idObject the idObject to set
* @param idObject
* the idObject to set
* @see #idObject
*/
public
void
setIdObject
(
Integer
idObject
)
{
this
.
idObject
=
idObject
;
}
/**
* @return the publicationCount
* @see #publicationCount
*/
public
Integer
getPublicationCount
()
{
return
publicationCount
;
}
/**
* @param publicationCount
* the publicationCount to set
* @see #publicationCount
*/
public
void
setPublicationCount
(
Integer
publicationCount
)
{
this
.
publicationCount
=
publicationCount
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment