Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Genesys Backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
19
Issues
19
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Genesys PGR
Genesys Backend
Commits
d316eacf
Commit
d316eacf
authored
Jun 28, 2017
by
Matija Obreza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BasicModel#isPersisted() from app-blocks:1.2-SNAPSHOT is a better test than getId() == null
parent
e745ea62
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
11 deletions
+11
-11
pom.xml
pom.xml
+1
-1
src/main/java/org/genesys2/server/service/impl/BatchRESTServiceImpl.java
...rg/genesys2/server/service/impl/BatchRESTServiceImpl.java
+3
-3
src/main/java/org/genesys2/server/service/impl/GenesysServiceImpl.java
.../org/genesys2/server/service/impl/GenesysServiceImpl.java
+6
-6
src/main/java/org/genesys2/server/servlet/controller/rest/OAuthManagementController.java
...er/servlet/controller/rest/OAuthManagementController.java
+1
-1
No files found.
pom.xml
View file @
d316eacf
...
...
@@ -58,7 +58,7 @@
<snippetsDirectory>
${project.build.directory}/generated-snippets
</snippetsDirectory>
<junit.version>
4.12
</junit.version>
<application.blocks.version>
1.
1
-SNAPSHOT
</application.blocks.version>
<application.blocks.version>
1.
2
-SNAPSHOT
</application.blocks.version>
<commons.beanutils.version>
1.9.2
</commons.beanutils.version>
<commons.collections.version>
3.2.1
</commons.collections.version>
<commons.fileupload.version>
1.3.1
</commons.fileupload.version>
...
...
src/main/java/org/genesys2/server/service/impl/BatchRESTServiceImpl.java
View file @
d316eacf
...
...
@@ -96,7 +96,7 @@ public class BatchRESTServiceImpl implements BatchRESTService {
@Autowired
private
TaxonomyManager
taxonomyManager
;
@Override
// Read-only, everything happens in manager
@PreAuthorize
(
"hasRole('ADMINISTRATOR') or hasPermission(#institute, 'WRITE') or hasPermission(#institute, 'CREATE')"
)
...
...
@@ -256,7 +256,7 @@ public class BatchRESTServiceImpl implements BatchRESTService {
upsertResult
.
setUUID
(
accession
.
getUuid
());
}
if
(
accession
.
getAccessionId
().
getId
()
==
null
||
useUniqueAcceNumbs
&&
accnJson
.
get
(
Api1Constants
.
Accession
.
GENUS
)
!=
null
if
(
accession
.
getAccessionId
().
isPersisted
()
||
useUniqueAcceNumbs
&&
accnJson
.
get
(
Api1Constants
.
Accession
.
GENUS
)
!=
null
||
accnJson
.
get
(
Api1Constants
.
Accession
.
GENUS_NEW
)
!=
null
||
accnJson
.
get
(
Api1Constants
.
Accession
.
SPECIES
)
!=
null
||
accnJson
.
get
(
Api1Constants
.
Accession
.
SPAUTHOR
)
!=
null
||
accnJson
.
get
(
Api1Constants
.
Accession
.
SUBTAXA
)
!=
null
||
accnJson
.
get
(
Api1Constants
.
Accession
.
SUBTAUTHOR
)
!=
null
)
{
...
...
@@ -728,7 +728,7 @@ public class BatchRESTServiceImpl implements BatchRESTService {
private
boolean
updateAcceNumb
(
AccessionData
accession
,
JsonNode
value
)
throws
RESTApiDataTypeException
,
RESTApiException
{
if
(
value
!=
null
)
{
// Rename is possible only if accession exists
if
(
accession
.
getAccessionId
().
getId
()
==
null
)
{
if
(
!
accession
.
getAccessionId
().
isPersisted
()
)
{
throw
new
RESTApiException
(
"Cannot rename a new accession entry"
);
}
...
...
src/main/java/org/genesys2/server/service/impl/GenesysServiceImpl.java
View file @
d316eacf
...
...
@@ -400,7 +400,7 @@ public class GenesysServiceImpl implements GenesysService, DatasetService {
@Override
public
AccessionBreeding
listAccessionBreeding
(
AccessionId
accession
)
{
if
(
accession
==
null
||
accession
.
getId
()
==
null
)
{
if
(
accession
==
null
||
!
accession
.
isPersisted
()
)
{
return
null
;
}
return
accessionBreedingRepository
.
findByAccession
(
accession
);
...
...
@@ -408,7 +408,7 @@ public class GenesysServiceImpl implements GenesysService, DatasetService {
@Override
public
AccessionGeo
listAccessionGeo
(
AccessionId
accession
)
{
if
(
accession
==
null
||
accession
.
getId
()
==
null
)
{
if
(
accession
==
null
||
!
accession
.
isPersisted
()
)
{
return
null
;
}
return
accessionGeoRepository
.
findByAccession
(
accession
);
...
...
@@ -432,7 +432,7 @@ public class GenesysServiceImpl implements GenesysService, DatasetService {
@Override
public
AccessionCollect
listAccessionCollect
(
AccessionId
accession
)
{
if
(
accession
==
null
||
accession
.
getId
()
==
null
)
{
if
(
accession
==
null
||
!
accession
.
isPersisted
()
)
{
return
null
;
}
return
accessionCollectRepository
.
findByAccession
(
accession
);
...
...
@@ -440,7 +440,7 @@ public class GenesysServiceImpl implements GenesysService, DatasetService {
@Override
public
AccessionExchange
listAccessionExchange
(
AccessionId
accession
)
{
if
(
accession
==
null
||
accession
.
getId
()
==
null
)
{
if
(
accession
==
null
||
!
accession
.
isPersisted
()
)
{
return
null
;
}
return
accessionExchangeRepository
.
findByAccession
(
accession
);
...
...
@@ -448,7 +448,7 @@ public class GenesysServiceImpl implements GenesysService, DatasetService {
@Override
public
List
<
AccessionRemark
>
listAccessionRemarks
(
AccessionId
accession
)
{
if
(
accession
==
null
||
accession
.
getId
()
==
null
)
{
if
(
accession
==
null
||
!
accession
.
isPersisted
()
)
{
return
null
;
}
return
accessionRemarkRepository
.
findByAccession
(
accession
);
...
...
@@ -630,7 +630,7 @@ public class GenesysServiceImpl implements GenesysService, DatasetService {
}
private
AccessionData
getAccessionData
(
AccessionId
accessionId
)
{
if
(
accessionId
==
null
)
if
(
accessionId
==
null
||
!
accessionId
.
isPersisted
()
)
return
null
;
return
getAccessionData
(
accessionId
.
getId
());
}
...
...
src/main/java/org/genesys2/server/servlet/controller/rest/OAuthManagementController.java
View file @
d316eacf
...
...
@@ -128,7 +128,7 @@ public class OAuthManagementController extends RequestsController {
OAuthClientDetails
clientDetails
;
if
(
requestClient
.
getId
()
==
null
)
{
if
(
!
requestClient
.
isPersisted
()
)
{
clientDetails
=
clientDetailsService
.
addClientDetails
(
requestClient
.
getTitle
(),
requestClient
.
getDescription
(),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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