Commit a55dc0c8 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

chnage serialization field names to be consistent with old format

parent 01cd6048
...@@ -11,6 +11,7 @@ import org.hibernate.annotations.Cascade; ...@@ -11,6 +11,7 @@ import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType; import org.hibernate.annotations.CascadeType;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lcsb.mapviewer.common.exception.NotImplementedException; import lcsb.mapviewer.common.exception.NotImplementedException;
...@@ -312,6 +313,7 @@ public class ProjectBackground implements Serializable { ...@@ -312,6 +313,7 @@ public class ProjectBackground implements Serializable {
this.defaultOverlay = defaultOverlay; this.defaultOverlay = defaultOverlay;
} }
@JsonProperty("order")
public int getOrderIndex() { public int getOrderIndex() {
return orderIndex; return orderIndex;
} }
...@@ -332,6 +334,7 @@ public class ProjectBackground implements Serializable { ...@@ -332,6 +334,7 @@ public class ProjectBackground implements Serializable {
} }
} }
@JsonProperty("images")
public Set<ProjectBackgroundImageLayer> getProjectBackgroundImageLayer() { public Set<ProjectBackgroundImageLayer> getProjectBackgroundImageLayer() {
return backgrounds; return backgrounds;
} }
......
...@@ -804,7 +804,7 @@ public class ProjectRestImpl extends BaseRestImpl { ...@@ -804,7 +804,7 @@ public class ProjectRestImpl extends BaseRestImpl {
throw new QueryException("name cannot be empty"); throw new QueryException("name cannot be empty");
} }
background.setName((String) value); background.setName((String) value);
} else if (key.equalsIgnoreCase("orderIndex")) { } else if (key.equalsIgnoreCase("order")) {
background.setOrderIndex(parseInteger(value)); background.setOrderIndex(parseInteger(value));
} else if (key.equalsIgnoreCase("defaultOverlay")) { } else if (key.equalsIgnoreCase("defaultOverlay")) {
background.setDefaultOverlay(parseBoolean(value)); background.setDefaultOverlay(parseBoolean(value));
......
...@@ -986,19 +986,19 @@ public class ProjectControllerIntegrationTest extends ControllerIntegrationTest ...@@ -986,19 +986,19 @@ public class ProjectControllerIntegrationTest extends ControllerIntegrationTest
fieldWithPath("progress") fieldWithPath("progress")
.type(JsonFieldType.NUMBER) .type(JsonFieldType.NUMBER)
.description("generating images progress information (in %)"), .description("generating images progress information (in %)"),
fieldWithPath("orderIndex") fieldWithPath("order")
.type(JsonFieldType.NUMBER) .type(JsonFieldType.NUMBER)
.description("order used when listing all backgrounds"), .description("order used when listing all backgrounds"),
fieldWithPath("projectBackgroundImageLayer[].id") fieldWithPath("images[].id")
.type(JsonFieldType.NUMBER) .type(JsonFieldType.NUMBER)
.ignored(), .ignored(),
fieldWithPath("projectBackgroundImageLayer[].projectBackground.id") fieldWithPath("images[].projectBackground.id")
.type(JsonFieldType.NUMBER) .type(JsonFieldType.NUMBER)
.ignored(), .ignored(),
fieldWithPath("projectBackgroundImageLayer[].directory") fieldWithPath("images[].directory")
.type(JsonFieldType.STRING) .type(JsonFieldType.STRING)
.description("directory where background tiles are located"), .description("directory where background tiles are located"),
fieldWithPath("projectBackgroundImageLayer[].model.id") fieldWithPath("images[].model.id")
.type(JsonFieldType.NUMBER) .type(JsonFieldType.NUMBER)
.description("(sub)map for which images are described"), .description("(sub)map for which images are described"),
fieldWithPath("defaultOverlay") fieldWithPath("defaultOverlay")
......
Markdown is supported
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