diff --git a/pom.xml b/pom.xml
index 80fe937..18fd2a3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
edu.stanford.protege
webprotege-forms
- 1.1.3
+ 1.1.5
webprotege-forms
Data structures and request/responses for forms
diff --git a/src/main/java/edu/stanford/protege/webprotege/forms/PropertyNames.java b/src/main/java/edu/stanford/protege/webprotege/forms/PropertyNames.java
new file mode 100644
index 0000000..976557b
--- /dev/null
+++ b/src/main/java/edu/stanford/protege/webprotege/forms/PropertyNames.java
@@ -0,0 +1,137 @@
+package edu.stanford.protege.webprotege.forms;
+
+/**
+ * Matthew Horridge
+ * Stanford Center for Biomedical Informatics Research
+ * 2024-06-18
+ */
+public interface PropertyNames {
+
+ String DESCRIPTOR = "descriptor";
+
+ String CONTROL = "control";
+
+ String CRITERIA = "criteria";
+
+ String MATCH_TYPE = "matchType";
+
+ String ENTITY = "entity";
+
+ String DEPTH = "depth";
+
+ String SUBJECT = "subject";
+
+ String REGION_ID = "regionId";
+
+ String COLUMN_ID = "columnId";
+
+ String VALUES = "values";
+
+ String FILTER_STATE = "filterState";
+
+ String ROWS = "rows";
+
+ String ORDERING = "ordering";
+
+ String CELLS = "cells";
+
+ String IRI = "iri";
+
+ String LITERAL = "literal";
+
+ String VALUE = "value";
+
+ String CHOICE = "choice";
+
+ String LABEL = "label";
+
+ String PLACEHOLDER = "placeholder";
+
+ String CHOICES = "choices";
+
+ String ID = "id";
+
+ String OWL_BINDING = "owlBinding";
+
+ String FIELD_RUN = "fieldRun";
+
+ String REPEATABILITY = "repeatability";
+
+ String OPTIONALITY = "optionality";
+
+ String READ_ONLY = "readOnly";
+
+ String INITIAL_EXPANSIONS_STATE = "initialExpansionState";
+
+ String HELP = "help";
+
+ String DEPRECATION_STRATEGY = "deprecationStrategy";
+
+ String DIRECTION = "direction";
+
+ String COLUMNS = "columns";
+
+ String SUBJECT_FACTORY = "subjectFactory";
+
+ String CHOICES_SOURCE = "choicesSource";
+
+ String FORMAT = "format";
+
+ String RANGE = "range";
+
+ String WIDGET_TYPE = "widgetType";
+
+ String LENGTH = "length";
+
+ String LOWER_BOUND = "lowerBound";
+
+ String UPPER_BOUND = "upperBound";
+
+ String LOWER_BOUND_TYPE = "lowerBoundType";
+
+ String UPPER_BOUND_TYPE = "upperBoundType";
+
+ String PROPERTY = "property";
+
+ String DEFAULT_CHOICE = "defaultChoice";
+
+ String STRING_TYPE = "stringType";
+
+ String SPECIFIC_LANG_TAG = "specificLangTag";
+
+ String LINE_MODE = "lineMode";
+
+ String PATTERN = "pattern";
+
+ String PATTERN_VIOLATION_ERROR_MESSAGE = "patternViolationErrorMessage";
+
+ String PROJECT_ID = "projectId";
+
+ String FORM_ID = "formId";
+
+ String PURPOSE = "purpose";
+
+ String FIELDS = "fields";
+
+ String ORDINAL = "ordinal";
+
+ String DESCRIPTION = "description";
+
+ String FORMS = "forms";
+
+ String SOURCE_TYPE = "sourceType";
+
+ String PAGE_REQUEST = "pageRequest";
+
+ String ENTITY_TYPE = "entityType";
+
+ String PARENT = "parent";
+
+ String TARGET_ONTOLOGY_IRI = "targetOntologyIri";
+
+ String FORM = "form";
+
+ String DATA = "data";
+
+ String FIELD = "field";
+}
diff --git a/src/main/java/edu/stanford/protege/webprotege/forms/data/EntityNameControlData.java b/src/main/java/edu/stanford/protege/webprotege/forms/data/EntityNameControlData.java
index 2f04a2a..97984a4 100644
--- a/src/main/java/edu/stanford/protege/webprotege/forms/data/EntityNameControlData.java
+++ b/src/main/java/edu/stanford/protege/webprotege/forms/data/EntityNameControlData.java
@@ -24,7 +24,7 @@ public abstract class EntityNameControlData implements FormControlData {
@JsonCreator
public static EntityNameControlData get(@JsonProperty("descriptor") @Nonnull EntityNameControlDescriptor descriptor,
- @JsonProperty("term") @Nullable OWLEntity entity) {
+ @JsonProperty("entity") @Nullable OWLEntity entity) {
return new AutoValue_EntityNameControlData(descriptor, entity);
}
@@ -39,6 +39,7 @@ public void accept(@Nonnull FormControlDataVisitor visitor) {
}
@Nonnull
+ @JsonProperty("descriptor")
public abstract EntityNameControlDescriptor getDescriptor();
@Nullable
diff --git a/src/main/java/edu/stanford/protege/webprotege/forms/data/GridCellData.java b/src/main/java/edu/stanford/protege/webprotege/forms/data/GridCellData.java
index fc26e07..adbe0ca 100644
--- a/src/main/java/edu/stanford/protege/webprotege/forms/data/GridCellData.java
+++ b/src/main/java/edu/stanford/protege/webprotege/forms/data/GridCellData.java
@@ -1,7 +1,9 @@
package edu.stanford.protege.webprotege.forms.data;
+import com.fasterxml.jackson.annotation.*;
import com.google.auto.value.AutoValue;
import edu.stanford.protege.webprotege.common.Page;
+import edu.stanford.protege.webprotege.forms.PropertyNames;
import edu.stanford.protege.webprotege.forms.field.GridColumnId;
import org.semanticweb.owlapi.model.OWLEntity;
import org.semanticweb.owlapi.model.OWLLiteral;
@@ -20,7 +22,9 @@
public abstract class GridCellData {
- public static GridCellData get(@Nonnull GridColumnId columnId, @Nullable Page values) {
+ @JsonCreator
+ public static GridCellData get(@JsonProperty(PropertyNames.COLUMN_ID) @Nonnull GridColumnId columnId,
+ @JsonProperty(PropertyNames.VALUES) @Nullable Page values) {
return new AutoValue_GridCellData(columnId, values);
}
@@ -57,9 +61,11 @@ public int compareTo(GridCellData otherCellData) {
return 0;
}
+ @JsonProperty(PropertyNames.COLUMN_ID)
@Nonnull
public abstract GridColumnId getColumnId();
+ @JsonProperty(PropertyNames.VALUES)
@Nonnull
public abstract Page getValues();
}
diff --git a/src/main/java/edu/stanford/protege/webprotege/forms/data/GridControlData.java b/src/main/java/edu/stanford/protege/webprotege/forms/data/GridControlData.java
index 862d978..4e4c880 100644
--- a/src/main/java/edu/stanford/protege/webprotege/forms/data/GridControlData.java
+++ b/src/main/java/edu/stanford/protege/webprotege/forms/data/GridControlData.java
@@ -1,9 +1,10 @@
package edu.stanford.protege.webprotege.forms.data;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.*;
import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableSet;
import edu.stanford.protege.webprotege.common.Page;
+import edu.stanford.protege.webprotege.forms.PropertyNames;
import edu.stanford.protege.webprotege.forms.field.FormRegionOrdering;
import edu.stanford.protege.webprotege.forms.field.GridControlDescriptor;
@@ -19,10 +20,11 @@
@JsonTypeName("GridControlData")
public abstract class GridControlData implements ComplexFormControlValue {
+ @JsonCreator
@Nonnull
- public static GridControlData get(@Nonnull GridControlDescriptor descriptor,
- @Nonnull Page rows,
- @Nonnull ImmutableSet ordering) {
+ public static GridControlData get(@JsonProperty(PropertyNames.DESCRIPTOR) @Nonnull GridControlDescriptor descriptor,
+ @JsonProperty(PropertyNames.ROWS) @Nonnull Page rows,
+ @JsonProperty(PropertyNames.ORDERING) @Nonnull ImmutableSet ordering) {
return new AutoValue_GridControlData(descriptor, rows, ordering);
}
@@ -36,12 +38,15 @@ public void accept(@Nonnull FormControlDataVisitor visitor) {
visitor.visit(this);
}
+ @JsonProperty(PropertyNames.DESCRIPTOR)
@Nonnull
public abstract GridControlDescriptor getDescriptor();
+ @JsonProperty(PropertyNames.ROWS)
@Nonnull
public abstract Page getRows();
+ @JsonProperty(PropertyNames.ORDERING)
@Nonnull
public abstract ImmutableSet getOrdering();
}
diff --git a/src/main/java/edu/stanford/protege/webprotege/forms/data/GridRowData.java b/src/main/java/edu/stanford/protege/webprotege/forms/data/GridRowData.java
index 34ee041..7fbe573 100644
--- a/src/main/java/edu/stanford/protege/webprotege/forms/data/GridRowData.java
+++ b/src/main/java/edu/stanford/protege/webprotege/forms/data/GridRowData.java
@@ -1,7 +1,11 @@
package edu.stanford.protege.webprotege.forms.data;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableList;
+import edu.stanford.protege.webprotege.forms.PropertyNames;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -16,19 +20,24 @@
public abstract class GridRowData implements Comparable {
- public static GridRowData get(@Nullable FormEntitySubject subject, @Nonnull ImmutableList cellData) {
+ @JsonCreator
+ public static GridRowData get(@JsonProperty(PropertyNames.SUBJECT) @Nullable FormEntitySubject subject,
+ @JsonProperty(PropertyNames.CELLS) @Nonnull ImmutableList cellData) {
return new AutoValue_GridRowData(subject, cellData);
}
+ @JsonProperty(PropertyNames.SUBJECT)
@Nullable
protected abstract FormEntitySubject getSubjectInternal();
+ @JsonIgnore
@Nonnull
public Optional getSubject() {
return Optional.ofNullable(getSubjectInternal());
}
+ @JsonProperty(PropertyNames.CELLS)
@Nonnull
public abstract ImmutableList getCells();
diff --git a/src/main/java/edu/stanford/protege/webprotege/forms/data/MultiChoiceControlData.java b/src/main/java/edu/stanford/protege/webprotege/forms/data/MultiChoiceControlData.java
index c5e316a..6616a3a 100644
--- a/src/main/java/edu/stanford/protege/webprotege/forms/data/MultiChoiceControlData.java
+++ b/src/main/java/edu/stanford/protege/webprotege/forms/data/MultiChoiceControlData.java
@@ -1,5 +1,6 @@
package edu.stanford.protege.webprotege.forms.data;
+import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.google.auto.value.AutoValue;
@@ -18,6 +19,8 @@
@JsonTypeName("MultiChoiceControlData")
public abstract class MultiChoiceControlData implements FormControlData {
+
+ @JsonCreator
public static MultiChoiceControlData get(@JsonProperty("descriptor") @Nonnull MultiChoiceControlDescriptor descriptor,
@JsonProperty("values") @Nonnull ImmutableList values) {
return new AutoValue_MultiChoiceControlData(descriptor, values);
diff --git a/src/main/java/edu/stanford/protege/webprotege/forms/data/NumberControlData.java b/src/main/java/edu/stanford/protege/webprotege/forms/data/NumberControlData.java
index f0e4438..a66ef0a 100644
--- a/src/main/java/edu/stanford/protege/webprotege/forms/data/NumberControlData.java
+++ b/src/main/java/edu/stanford/protege/webprotege/forms/data/NumberControlData.java
@@ -23,7 +23,7 @@
public abstract class NumberControlData implements FormControlData {
@JsonCreator
- public static NumberControlData get(@Nonnull NumberControlDescriptor descriptor, @Nullable OWLLiteral value) {
+ public static NumberControlData get(@Nonnull @JsonProperty("descriptor") NumberControlDescriptor descriptor, @JsonProperty("value") @Nullable OWLLiteral value) {
return new AutoValue_NumberControlData(descriptor, value);
}
@@ -38,6 +38,7 @@ public void accept(@Nonnull FormControlDataVisitor visitor) {
}
@Nonnull
+ @JsonProperty("descriptor")
public abstract NumberControlDescriptor getDescriptor();
@JsonProperty("value")
diff --git a/src/main/java/edu/stanford/protege/webprotege/forms/data/SingleChoiceControlData.java b/src/main/java/edu/stanford/protege/webprotege/forms/data/SingleChoiceControlData.java
index 03a16c5..cfb1c85 100644
--- a/src/main/java/edu/stanford/protege/webprotege/forms/data/SingleChoiceControlData.java
+++ b/src/main/java/edu/stanford/protege/webprotege/forms/data/SingleChoiceControlData.java
@@ -38,6 +38,7 @@ public void accept(@Nonnull FormControlDataVisitor visitor) {
}
@Nonnull
+ @JsonProperty("descriptor")
public abstract SingleChoiceControlDescriptor getDescriptor();
@JsonProperty("choice")