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
4ede2380
Commit
4ede2380
authored
Nov 20, 2014
by
Matija Obreza
Browse files
API: Should not be able to rename a new accession entry
parent
2019f1ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/service/impl/BatchRESTServiceImpl.java
View file @
4ede2380
...
...
@@ -560,8 +560,13 @@ public class BatchRESTServiceImpl implements BatchRESTService {
return
null
;
}
private
boolean
updateAcceNumb
(
Accession
accession
,
JsonNode
value
)
throws
RESTApiDataTypeException
,
RESTApi
Value
Exception
{
private
boolean
updateAcceNumb
(
Accession
accession
,
JsonNode
value
)
throws
RESTApiDataTypeException
,
RESTApiException
{
if
(
value
!=
null
)
{
// Rename is possible only if accession exists
if
(
accession
.
getId
()
==
null
)
{
throw
new
RESTApiException
(
"Cannot rename a new accession entry"
);
}
if
(!
value
.
isTextual
())
{
throw
new
RESTApiDataTypeException
(
"newAcceNumb must be a String"
);
}
...
...
@@ -899,7 +904,7 @@ public class BatchRESTServiceImpl implements BatchRESTService {
}
if
(!
institute
.
getCode
().
equals
(
dataJson
.
instCode
))
{
throw
new
R
untime
Exception
(
"Accession does not belong to instCode="
+
institute
.
getCode
()
+
" acn="
+
dataJson
);
throw
new
R
ESTApi
Exception
(
"Accession does not belong to instCode="
+
institute
.
getCode
()
+
" acn="
+
dataJson
);
}
Accession
accession
;
...
...
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