Refs #11288: Made resource-registry more RESTful

Task-Url: https://support.d4science.org/issues/11288

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@169072 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2018-06-12 14:43:47 +00:00
parent 5fb6eae171
commit 4f07e57030
1 changed files with 10 additions and 3 deletions

View File

@ -165,10 +165,17 @@ public abstract class ERManagement<ERType extends ER, El extends Element> {
} }
public void setElementType(String erType) throws ResourceRegistryException { public void setElementType(String erType) throws ResourceRegistryException {
this.elementType = erType; if(this.elementType==null) {
if(erType == null || erType.compareTo("") == 0) { if(erType == null || erType.compareTo("") == 0) {
erType = accessType.getName(); erType = accessType.getName();
} }
this.elementType = erType;
}else {
if(elementType.compareTo(erType)!=0) {
throw new ResourceRegistryException("Provided type " + erType + " does not match with the one already known " + this.accessType);
}
}
if(jsonNode != null) { if(jsonNode != null) {
checkERMatch(); checkERMatch();
} }