Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Backend
Commits
efebf219
Commit
efebf219
authored
Jan 07, 2014
by
Matija Obreza
Browse files
Use JSON_OK response instead of boolean
parent
62d18c6f
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/servlet/controller/rest/AccessionController.java
View file @
efebf219
...
...
@@ -145,7 +145,6 @@ public class AccessionController extends RestController {
return
rets
;
}
/**
* Update accessions in the system
*
...
...
@@ -155,8 +154,9 @@ public class AccessionController extends RestController {
*/
@RequestMapping
(
value
=
"/{instCode}/upsert"
,
method
=
{
RequestMethod
.
POST
,
RequestMethod
.
PUT
},
produces
=
{
MediaType
.
APPLICATION_JSON_VALUE
})
public
@ResponseBody
boolean
upsertInstituteAccession
(
@PathVariable
(
"instCode"
)
String
instCode
,
@RequestBody
String
content
)
throws
JsonProcessingException
,
IOException
{
// User's permission to WRITE to this WIEWS institute are checked in BatchRESTService.
String
upsertInstituteAccession
(
@PathVariable
(
"instCode"
)
String
instCode
,
@RequestBody
String
content
)
throws
JsonProcessingException
,
IOException
{
// User's permission to WRITE to this WIEWS institute are checked in
// BatchRESTService.
FaoInstitute
institute
=
instituteService
.
getInstitute
(
instCode
);
if
(
institute
==
null
)
{
throw
new
ResourceNotFoundException
();
...
...
@@ -181,7 +181,8 @@ public class AccessionController extends RestController {
batch
.
put
(
dataJson
,
(
ObjectNode
)
json
);
}
return
batchRESTService
.
upsertAccessionData
(
institute
,
batch
);
batchRESTService
.
upsertAccessionData
(
institute
,
batch
);
return
JSON_OK
;
}
private
BatchRESTService
.
DataJson
readAid3
(
JsonNode
json
)
{
...
...
src/main/java/org/genesys2/server/servlet/controller/rest/PermissionController.java
View file @
efebf219
...
...
@@ -48,7 +48,8 @@ public class PermissionController extends RestController {
Permission
[]
permissions
=
new
Permission
[]
{
BasePermission
.
CREATE
,
BasePermission
.
DELETE
,
BasePermission
.
READ
,
BasePermission
.
WRITE
,
BasePermission
.
ADMINISTRATION
};
return
aclService
.
addPermissions
(
permissionJson
.
oid
,
permissionJson
.
clazz
,
permissionJson
.
uuid
,
permissionJson
.
principal
,
permissions
);
aclService
.
addPermissions
(
permissionJson
.
oid
,
permissionJson
.
clazz
,
permissionJson
.
uuid
,
permissionJson
.
principal
,
permissions
);
return
JSON_OK
;
}
public
static
class
PermissionJson
{
...
...
src/main/java/org/genesys2/server/servlet/controller/rest/RestController.java
View file @
efebf219
...
...
@@ -17,6 +17,8 @@ import org.springframework.web.bind.annotation.ResponseBody;
public
abstract
class
RestController
{
protected
final
Log
LOG
=
LogFactory
.
getLog
(
getClass
());
protected
static
final
String
JSON_OK
=
"{\"result\":true}"
;
public
RestController
()
{
super
();
}
...
...
src/main/java/org/genesys2/server/servlet/controller/rest/UserController.java
View file @
efebf219
...
...
@@ -47,8 +47,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
public
class
UserController
extends
RestController
{
private
static
final
Log
LOG
=
LogFactory
.
getLog
(
UserController
.
class
);
private
static
final
String
JSON_OK
=
"{\"response\":\"OK\"}"
;
@Autowired
protected
UserService
userService
;
...
...
Write
Preview
Supports
Markdown
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!
Cancel
Please
register
or
sign in
to comment