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
fea8fa5a
Commit
fea8fa5a
authored
9 years ago
by
Mirco Nasuti
Browse files
Options
Downloads
Patches
Plain Diff
bugfix : agreeNDA
parent
7e2f2176
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/org/hbp/mip/MIPApplication.java
+10
-4
10 additions, 4 deletions
src/main/java/org/hbp/mip/MIPApplication.java
src/main/java/org/hbp/mip/controllers/MiningApi.java
+1
-1
1 addition, 1 deletion
src/main/java/org/hbp/mip/controllers/MiningApi.java
with
11 additions
and
5 deletions
src/main/java/org/hbp/mip/MIPApplication.java
+
10
−
4
View file @
fea8fa5a
...
...
@@ -128,6 +128,11 @@ public class MIPApplication extends WebSecurityConfigurerAdapter {
User
user
=
new
User
(
getUserInfos
());
try
{
session
.
beginTransaction
();
Boolean
agreeNDA
=
(
Boolean
)
session
.
createQuery
(
"SELECT agreeNDA FROM User WHERE username= :username"
)
.
setString
(
"username"
,
user
.
getUsername
())
.
uniqueResult
();
user
.
setAgreeNDA
(
agreeNDA
);
session
.
merge
(
user
);
session
.
getTransaction
().
commit
();
}
catch
(
Exception
e
)
...
...
@@ -135,6 +140,7 @@ public class MIPApplication extends WebSecurityConfigurerAdapter {
if
(
session
.
getTransaction
()
!=
null
)
{
session
.
getTransaction
().
rollback
();
throw
e
;
}
}
...
...
@@ -183,15 +189,14 @@ public class MIPApplication extends WebSecurityConfigurerAdapter {
}
@RequestMapping
(
path
=
"/user"
,
method
=
RequestMethod
.
POST
)
public
ResponseEntity
<
Void
>
postUser
(
Principal
principal
,
HttpServletResponse
response
,
@ApiParam
(
value
=
"Has the user agreed on the NDA"
)
@RequestParam
(
value
=
"agreeNDA"
,
required
=
true
)
Boolean
agreeNDA
)
{
ObjectMapper
mapper
=
new
ObjectMapper
();
public
ResponseEntity
<
Void
>
postUser
(
@ApiParam
(
value
=
"Has the user agreed on the NDA"
)
@RequestParam
(
value
=
"agreeNDA"
,
required
=
true
)
Boolean
agreeNDA
)
{
String
username
=
getUser
().
getUsername
();
Session
session
=
HibernateUtil
.
getSessionFactory
().
getCurrentSession
();
try
{
session
.
beginTransaction
();
User
user
=
(
User
)
session
.
createQuery
(
"from User where username= :username"
)
.
setString
(
"username"
,
principal
.
getN
ame
()
)
.
setString
(
"username"
,
usern
ame
)
.
uniqueResult
();
if
(
user
!=
null
)
{
user
.
setAgreeNDA
(
agreeNDA
);
...
...
@@ -203,6 +208,7 @@ public class MIPApplication extends WebSecurityConfigurerAdapter {
if
(
session
.
getTransaction
()
!=
null
)
{
session
.
getTransaction
().
rollback
();
throw
e
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/org/hbp/mip/controllers/MiningApi.java
+
1
−
1
View file @
fea8fa5a
...
...
@@ -31,7 +31,7 @@ public class MiningApi {
@ApiResponses
(
value
=
{
@ApiResponse
(
code
=
200
,
message
=
"Success"
)
})
@RequestMapping
(
method
=
RequestMethod
.
POST
)
public
ResponseEntity
<
String
>
postMining
(
@RequestBody
@ApiParam
(
value
=
"
Model to create
"
,
required
=
true
)
String
query
@RequestBody
@ApiParam
(
value
=
"
Query for the data mining
"
,
required
=
true
)
String
query
)
throws
Exception
{
StringBuilder
results
=
new
StringBuilder
();
...
...
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