Skip to content
Snippets Groups Projects
Commit 6bdb5516 authored by felmer's avatar felmer
Browse files

SSDM-13672: V3 API extension: Flag codeBeatsAutoGeneratedCode added to...

SSDM-13672: V3 API extension: Flag codeBeatsAutoGeneratedCode added to SampleCreation. This allows to specify sample code even though sample type has autoGeneratedCode set
parent 5b5fb162
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
...@@ -60,6 +60,8 @@ public class SampleCreation implements ICreation, ICreationIdHolder, IProperties ...@@ -60,6 +60,8 @@ public class SampleCreation implements ICreation, ICreationIdHolder, IProperties
private boolean autoGeneratedCode; private boolean autoGeneratedCode;
private boolean codeBeatsAutoGeneratedCode;
private List<? extends ITagId> tagIds; private List<? extends ITagId> tagIds;
private Map<String, String> properties = new HashMap<String, String>(); private Map<String, String> properties = new HashMap<String, String>();
...@@ -139,6 +141,16 @@ public class SampleCreation implements ICreation, ICreationIdHolder, IProperties ...@@ -139,6 +141,16 @@ public class SampleCreation implements ICreation, ICreationIdHolder, IProperties
this.autoGeneratedCode = autoGeneratedCode; this.autoGeneratedCode = autoGeneratedCode;
} }
public boolean isCodeBeatsAutoGeneratedCode()
{
return codeBeatsAutoGeneratedCode;
}
public void setCodeBeatsAutoGeneratedCode(boolean codeBeatsAutoGeneratedCode)
{
this.codeBeatsAutoGeneratedCode = codeBeatsAutoGeneratedCode;
}
public List<? extends ITagId> getTagIds() public List<? extends ITagId> getTagIds()
{ {
return tagIds; return tagIds;
......
...@@ -24,6 +24,7 @@ define([ "stjs", "as/dto/common/Relationship" ], function(stjs, Relationship) { ...@@ -24,6 +24,7 @@ define([ "stjs", "as/dto/common/Relationship" ], function(stjs, Relationship) {
prototype.attachments = null; prototype.attachments = null;
prototype.creationId = null; prototype.creationId = null;
prototype.autoGeneratedCode = null; prototype.autoGeneratedCode = null;
prototype.codeBeatsAutoGeneratedCode = null;
prototype.getTypeId = function() { prototype.getTypeId = function() {
return this.typeId; return this.typeId;
}; };
...@@ -60,6 +61,12 @@ define([ "stjs", "as/dto/common/Relationship" ], function(stjs, Relationship) { ...@@ -60,6 +61,12 @@ define([ "stjs", "as/dto/common/Relationship" ], function(stjs, Relationship) {
prototype.setAutoGeneratedCode = function(autoGeneratedCode) { prototype.setAutoGeneratedCode = function(autoGeneratedCode) {
this.autoGeneratedCode = autoGeneratedCode; this.autoGeneratedCode = autoGeneratedCode;
}; };
prototype.isCodeBeatsAutoGeneratedCode = function() {
return this.codeBeatsAutoGeneratedCode;
}
prototype.setCodeBeatsAutoGeneratedCode = function(codeBeatsAutoGeneratedCode) {
this.codeBeatsAutoGeneratedCode = codeBeatsAutoGeneratedCode;
};
prototype.getTagIds = function() { prototype.getTagIds = function() {
return this.tagIds; return this.tagIds;
}; };
......
...@@ -191,7 +191,9 @@ public class CreateSampleExecutor extends AbstractCreateEntityExecutor<SampleCre ...@@ -191,7 +191,9 @@ public class CreateSampleExecutor extends AbstractCreateEntityExecutor<SampleCre
} else if (type == null) } else if (type == null)
{ {
throw new ObjectNotFoundException(creation.getTypeId()); throw new ObjectNotFoundException(creation.getTypeId());
} else if (false == StringUtils.isEmpty(creation.getCode()) && (type.isAutoGeneratedCode() || creation.isAutoGeneratedCode())) } else if (false == StringUtils.isEmpty(creation.getCode())
&& (type.isAutoGeneratedCode() || creation.isAutoGeneratedCode())
&& creation.isCodeBeatsAutoGeneratedCode() == false)
{ {
throw new UserFailureException("Code should be empty when auto generated code is selected."); throw new UserFailureException("Code should be empty when auto generated code is selected.");
} else if (StringUtils.isEmpty(creation.getCode()) && false == type.isAutoGeneratedCode() } else if (StringUtils.isEmpty(creation.getCode()) && false == type.isAutoGeneratedCode()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment