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