Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
portal-backend
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HBP Medical Informatics Platform
portal-backend
Commits
14d5a1e5
Commit
14d5a1e5
authored
8 years ago
by
Mirco Nasuti
Browse files
Options
Downloads
Patches
Plain Diff
merge catalog without using model
parent
8da3323f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/hbp/mip/controllers/ExperimentApi.java
+6
-10
6 additions, 10 deletions
src/main/java/org/hbp/mip/controllers/ExperimentApi.java
with
6 additions
and
10 deletions
src/main/java/org/hbp/mip/controllers/ExperimentApi.java
+
6
−
10
View file @
14d5a1e5
...
...
@@ -3,13 +3,12 @@ package org.hbp.mip.controllers;
import
com.google.gson.Gson
;
import
com.google.gson.GsonBuilder
;
import
com.google.gson.JsonObject
;
import
com.google.gson.JsonParser
;
import
io.swagger.annotations.*
;
import
org.hbp.mip.MIPApplication
;
import
org.hbp.mip.model.Experiment
;
import
org.hbp.mip.model.Model
;
import
org.hbp.mip.model.User
;
import
org.hbp.mip.model.algorithm.Algorithm
;
import
org.hbp.mip.model.algorithm.Catalog
;
import
org.hbp.mip.utils.HTTPUtil
;
import
org.hbp.mip.utils.HibernateUtil
;
import
org.hibernate.Query
;
...
...
@@ -386,17 +385,14 @@ public class ExperimentApi {
return
new
ResponseEntity
<>(
response
.
toString
(),
HttpStatus
.
valueOf
(
code
));
}
Catalog
catalog
=
new
Gson
().
fromJson
(
response
.
toString
(),
Catalog
.
class
);
for
(
Algorithm
algo:
catalog
.
getAlgorithms
())
{
algo
.
setSource
(
"ML"
);
}
JsonObject
catalog
=
new
JsonParser
().
parse
(
response
.
toString
()).
getAsJsonObject
();
InputStream
is
=
Experiment
Api
.
class
.
getClassLoader
().
getResourceAsStream
(
EXAREME_ALGO_JSON_FILE
);
InputStream
is
=
Mining
Api
.
class
.
getClassLoader
().
getResourceAsStream
(
EXAREME_ALGO_JSON_FILE
);
InputStreamReader
isr
=
new
InputStreamReader
(
is
);
BufferedReader
br
=
new
BufferedReader
(
isr
);
Algorithm
exareme
GLR
=
new
G
son
().
fromJson
(
br
,
Algorithm
.
class
);
exaremeGLR
.
setSource
(
"exareme"
);
catalog
.
get
A
lgorithms
().
add
(
exareme
GLR
);
JsonObject
exareme
Algo
=
new
J
son
Parser
().
parse
(
br
).
getAsJsonObject
(
);
catalog
.
get
(
"a
lgorithms
"
).
getAsJsonArray
().
add
(
exareme
Algo
);
return
new
ResponseEntity
<>(
new
Gson
().
toJson
(
catalog
),
HttpStatus
.
valueOf
(
code
));
}
...
...
This diff is collapsed.
Click to expand it.
Preview
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!
Save comment
Cancel
Please
register
or
sign in
to comment