Commit 5e93cd17 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

colorSchemaType is obligatory

parent a31edec8
......@@ -80,6 +80,7 @@ public class Layout implements Serializable {
* Data overlay type. It can be null in such case it should be obtained from
* {@link #inputData}.
*/
@Column(nullable = false)
@Enumerated(EnumType.STRING)
private ColorSchemaType colorSchemaType = null;
......
update layout_table set color_schema_type ='GENETIC_VARIANT' where file_entry_id in (select id from file_entry_table where file_content like '%TYPE=GENE_%') and color_schema_type is null;
update layout_table set color_schema_type ='GENERIC' where color_schema_type is null;
ALTER TABLE layout_table ALTER COLUMN color_schema_type SET NOT NULL;
......@@ -10,8 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import lcsb.mapviewer.model.Project;
import lcsb.mapviewer.model.map.OverviewImage;
import lcsb.mapviewer.model.map.OverviewModelLink;
import lcsb.mapviewer.model.map.layout.DataOverlayImageLayer;
import lcsb.mapviewer.model.map.layout.Layout;
import lcsb.mapviewer.model.map.layout.*;
import lcsb.mapviewer.model.map.model.*;
import lcsb.mapviewer.model.map.species.Complex;
import lcsb.mapviewer.model.map.species.Species;
......@@ -240,6 +239,7 @@ public class ProjectDaoTest extends PersistTestFunctions {
Layout layout = new Layout();
layout.addDataOverlayImageLayer(new DataOverlayImageLayer(model, "tmp"));
layout.setColorSchemaType(ColorSchemaType.GENERIC);
layout.setTitle("temporary name");
project.addLayout(layout);
......
......@@ -14,8 +14,7 @@ import lcsb.mapviewer.model.Project;
import lcsb.mapviewer.model.cache.UploadedFileEntry;
import lcsb.mapviewer.model.map.*;
import lcsb.mapviewer.model.map.compartment.Compartment;
import lcsb.mapviewer.model.map.layout.DataOverlayImageLayer;
import lcsb.mapviewer.model.map.layout.Layout;
import lcsb.mapviewer.model.map.layout.*;
import lcsb.mapviewer.model.map.layout.graphics.Layer;
import lcsb.mapviewer.model.map.model.Model;
import lcsb.mapviewer.model.map.model.ModelFullIndexed;
......@@ -59,6 +58,7 @@ public class LayoutDaoTest extends PersistTestFunctions {
Layout layout = new Layout();
layout.addDataOverlayImageLayer(new DataOverlayImageLayer(model, "tmp"));
layout.setTitle("temporary name");
layout.setColorSchemaType(ColorSchemaType.GENERIC);
byte[] data = "test".getBytes();
UploadedFileEntry fileEntry = new UploadedFileEntry();
......@@ -101,6 +101,7 @@ public class LayoutDaoTest extends PersistTestFunctions {
Layout layout = new Layout();
layout.addDataOverlayImageLayer(new DataOverlayImageLayer(model, "tmp"));
layout.setColorSchemaType(ColorSchemaType.GENERIC);
layout.setTitle(tempName);
layout.setCreator(user);
project.addLayout(layout);
......@@ -184,6 +185,7 @@ public class LayoutDaoTest extends PersistTestFunctions {
assertEquals(0, result.size());
Layout layout = new Layout();
layout.setColorSchemaType(ColorSchemaType.GENERIC);
layout.addDataOverlayImageLayer(new DataOverlayImageLayer(model, "tmp"));
layout.setTitle("temporary name");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment