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
37617721
Commit
37617721
authored
6 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
mesh identifier cannot be set to something invalid
parent
afec2b06
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!541
version 12.1.3 into master
,
!527
Resolve "Unexpected error if MESH term is invalid"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rest-api/src/main/java/lcsb/mapviewer/api/projects/ProjectRestImpl.java
+20
-3
20 additions, 3 deletions
...ain/java/lcsb/mapviewer/api/projects/ProjectRestImpl.java
with
20 additions
and
3 deletions
rest-api/src/main/java/lcsb/mapviewer/api/projects/ProjectRestImpl.java
+
20
−
3
View file @
37617721
...
...
@@ -28,6 +28,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.MultiValueMap
;
import
lcsb.mapviewer.annotation.services.MeSHParser
;
import
lcsb.mapviewer.annotation.services.annotators.AnnotatorException
;
import
lcsb.mapviewer.api.BaseRestImpl
;
import
lcsb.mapviewer.api.ObjectExistsException
;
import
lcsb.mapviewer.api.ObjectNotFoundException
;
...
...
@@ -111,6 +113,9 @@ public class ProjectRestImpl extends BaseRestImpl {
@Autowired
private
IProjectService
projectService
;
@Autowired
private
MeSHParser
meshParser
;
@Autowired
private
ProjectDao
projectDao
;
...
...
@@ -549,8 +554,19 @@ public class ProjectRestImpl extends BaseRestImpl {
MiriamData
organism
=
updateMiriamData
(
project
.
getOrganism
(),
value
);
project
.
setOrganism
(
organism
);
}
else
if
(
fieldName
.
equalsIgnoreCase
(
"disease"
))
{
MiriamData
disease
=
updateMiriamData
(
project
.
getDisease
(),
value
);
project
.
setDisease
(
disease
);
try
{
MiriamData
sourceData
=
updateMiriamData
(
null
,
value
);
if
(
meshParser
.
isValidMeshId
(
sourceData
))
{
MiriamData
disease
=
updateMiriamData
(
project
.
getDisease
(),
value
);
project
.
setDisease
(
disease
);
}
else
if
(
sourceData
.
getResource
().
isEmpty
())
{
project
.
setDisease
(
null
);
}
else
{
throw
new
QueryException
(
"invalid mesh identifier: "
+
value
);
}
}
catch
(
AnnotatorException
e
)
{
throw
new
QueryException
(
"invalid miriamdData: "
+
value
,
e
);
}
}
else
if
(
fieldName
.
equalsIgnoreCase
(
"mapCanvasType"
))
{
MapCanvasType
mapCanvasType
;
try
{
...
...
@@ -740,7 +756,8 @@ public class ProjectRestImpl extends BaseRestImpl {
public
Map
<
String
,
Object
>
removeProject
(
String
token
,
String
projectId
,
String
path
)
throws
SecurityException
,
QueryException
{
Project
project
=
getProjectService
().
getProjectByProjectId
(
projectId
,
token
);
if
(
getConfigurationService
().
getConfigurationValue
(
ConfigurationElementType
.
DEFAULT_MAP
).
equals
(
project
.
getProjectId
()))
{
if
(
getConfigurationService
().
getConfigurationValue
(
ConfigurationElementType
.
DEFAULT_MAP
)
.
equals
(
project
.
getProjectId
()))
{
throw
new
OperationNotAllowedException
(
"You cannot remove default map"
);
}
getProjectService
().
removeProject
(
project
,
path
,
true
,
token
);
...
...
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