Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vospace-rest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
VOSpace INAF
vospace-rest
Commits
bbdd9290
"data-discovery/src/main/java/output/XmlSerializer.java" did not exist on "5e2b7f4c3e2fd161bb496c0f4feb42257b6027d3"
Commit
bbdd9290
authored
2 years ago
by
Nicola Fulvio Calabria
Browse files
Options
Downloads
Patches
Plain Diff
fixed create collection
parent
8c30f6fc
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/it/inaf/oats/vospace/CollectionsController.java
+8
-6
8 additions, 6 deletions
...main/java/it/inaf/oats/vospace/CollectionsController.java
with
8 additions
and
6 deletions
src/main/java/it/inaf/oats/vospace/CollectionsController.java
+
8
−
6
View file @
bbdd9290
...
...
@@ -6,6 +6,7 @@
package
it.inaf.oats.vospace
;
import
it.inaf.ia2.aa.data.User
;
import
it.inaf.oats.vospace.datamodel.collections.NodeCollection
;
import
it.inaf.oats.vospace.datamodel.collections.NodeCollectionsWrapper
;
import
javax.servlet.http.HttpServletRequest
;
import
org.slf4j.Logger
;
...
...
@@ -16,6 +17,7 @@ import org.springframework.web.bind.annotation.DeleteMapping;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
/**
...
...
@@ -47,11 +49,11 @@ public class CollectionsController {
// create a new collection with specified title
@PutMapping
(
value
=
"/collections"
)
public
ResponseEntity
<
String
>
createCollection
(
@RequestBody
String
c
ollection
Name
,
User
principal
)
{
@RequestBody
NodeC
ollection
nc
,
User
principal
)
{
LOG
.
debug
(
"create collection called with name {} called for user {}"
,
collectionName
,
principal
.
getName
());
nc
.
getTitle
()
,
principal
.
getName
());
collectionsService
.
createNewCollection
(
collectionName
,
principal
.
getName
());
collectionsService
.
createNewCollection
(
nc
.
getTitle
()
,
principal
.
getName
());
return
ResponseEntity
.
ok
(
"Collection created"
);
}
...
...
@@ -59,11 +61,11 @@ public class CollectionsController {
// delete collection by id
@DeleteMapping
(
value
=
"/collections"
)
public
ResponseEntity
<
String
>
deleteCollection
(
@Request
Body
Long
collectionI
d
,
User
principal
)
{
@Request
Param
(
"id"
)
Long
i
d
,
User
principal
)
{
LOG
.
debug
(
"delete collection called with id {} for user {}"
,
collectionI
d
,
principal
.
getName
());
i
d
,
principal
.
getName
());
collectionsService
.
deleteCollectionById
(
collectionI
d
,
principal
.
getName
());
collectionsService
.
deleteCollectionById
(
i
d
,
principal
.
getName
());
return
ResponseEntity
.
ok
(
"Collection deleted"
);
...
...
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