diff --git a/pom.xml b/pom.xml index e492f54..31a7700 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ edu.stanford.protege webprotege-backend-api - 0.9.5-SNAPSHOT + 0.9.7 UTF-8 @@ -76,7 +76,7 @@ edu.stanford.protege webprotege-common - 0.9.4 + 0.9.5 @@ -106,7 +106,7 @@ edu.stanford.protege webprotege-ontology-change - 0.9.2 + 0.9.3-SNAPSHOT diff --git a/src/main/java/edu/stanford/protege/webprotege/event/OntologyBrowserTextChangedEvent.java b/src/main/java/edu/stanford/protege/webprotege/event/OntologyBrowserTextChangedEvent.java index f605ce5..b561124 100644 --- a/src/main/java/edu/stanford/protege/webprotege/event/OntologyBrowserTextChangedEvent.java +++ b/src/main/java/edu/stanford/protege/webprotege/event/OntologyBrowserTextChangedEvent.java @@ -1,5 +1,6 @@ package edu.stanford.protege.webprotege.event; +import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import edu.stanford.protege.webprotege.common.EventId; import edu.stanford.protege.webprotege.common.ProjectEvent; @@ -19,6 +20,7 @@ */ @JsonTypeName("webprotege.events.ontologies.OntologyBrowserTextChanged") +@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "type") public record OntologyBrowserTextChangedEvent(EventId eventId, ProjectId projectId, OWLOntologyID ontologyID, diff --git a/src/main/java/edu/stanford/protege/webprotege/hierarchy/EdgeChange.java b/src/main/java/edu/stanford/protege/webprotege/hierarchy/EdgeChange.java index 5829cfb..1f20c7b 100644 --- a/src/main/java/edu/stanford/protege/webprotege/hierarchy/EdgeChange.java +++ b/src/main/java/edu/stanford/protege/webprotege/hierarchy/EdgeChange.java @@ -1,5 +1,8 @@ package edu.stanford.protege.webprotege.hierarchy; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; + import java.util.function.Consumer; /** @@ -7,18 +10,29 @@ * Stanford Center for Biomedical Informatics Research * 2021-04-20 */ +@JsonSubTypes({ + @JsonSubTypes.Type(AddEdge.class), + @JsonSubTypes.Type(RemoveEdge.class) +}) public abstract class EdgeChange extends GraphModelChange { - private final GraphEdge edge; + + private GraphEdge edge; + + protected EdgeChange() { + + } protected EdgeChange(GraphEdge edge) { this.edge = edge; } + @JsonIgnore public GraphNode getPredecessor() { return edge.getPredecessor(); } + @JsonIgnore public GraphNode getSuccessor() { return edge.getSuccessor(); } diff --git a/src/main/java/edu/stanford/protege/webprotege/hierarchy/GraphModelChange.java b/src/main/java/edu/stanford/protege/webprotege/hierarchy/GraphModelChange.java index e74c94d..cc29d40 100644 --- a/src/main/java/edu/stanford/protege/webprotege/hierarchy/GraphModelChange.java +++ b/src/main/java/edu/stanford/protege/webprotege/hierarchy/GraphModelChange.java @@ -12,12 +12,12 @@ * 2021-04-20 */ @JsonSubTypes({ - @Type(AddEdge.class), - @Type(RemoveEdge.class), + @Type(EdgeChange.class), @Type(AddRootNode.class), + @Type(UpdateUserObject.class), @Type(RemoveRootNode.class) }) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "changeType") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") public abstract class GraphModelChange { public GraphModelChange() {