Skip to content

Commit

Permalink
feat: Add text value type when creating resources (DEV-3721) (#3327)
Browse files Browse the repository at this point in the history
  • Loading branch information
BalduinLandolt authored Sep 3, 2024
1 parent 7b25174 commit 008fa98
Show file tree
Hide file tree
Showing 67 changed files with 2,788 additions and 629 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import org.knora.webapi.messages.v2.responder.standoffmessages.StandoffDataTypeC
import org.knora.webapi.messages.v2.responder.standoffmessages.StandoffTagIriAttributeV2
import org.knora.webapi.messages.v2.responder.standoffmessages.StandoffTagV2
import org.knora.webapi.messages.v2.responder.valuemessages.*
import org.knora.webapi.messages.v2.responder.valuemessages.TextValueType
import org.knora.webapi.sharedtestdata.SharedTestDataADM
import org.knora.webapi.slice.admin.domain.model.Permission

Expand Down Expand Up @@ -267,6 +268,7 @@ class ConstructResponseUtilV2SpecFullData(implicit stringFormatter: StringFormat
comment = None,
xslt = None,
mappingIri = Some("http://rdfh.ch/standoff/mappings/StandardMapping"),
textValueType = TextValueType.FormattedText,
),
valueIri = "http://rdfh.ch/0001/a-thing-with-text-values/values/1",
permissions = "CR knora-admin:Creator",
Expand Down Expand Up @@ -321,6 +323,7 @@ class ConstructResponseUtilV2SpecFullData(implicit stringFormatter: StringFormat
comment = None,
xslt = None,
mappingIri = Some("http://rdfh.ch/standoff/mappings/StandardMapping"),
textValueType = TextValueType.FormattedText,
),
valueIri = "http://rdfh.ch/0001/a-thing-with-text-values/values/2",
permissions = "CR knora-admin:Creator",
Expand Down Expand Up @@ -419,6 +422,7 @@ class ConstructResponseUtilV2SpecFullData(implicit stringFormatter: StringFormat
ontologySchema = InternalSchema,
maybeValueHasString = Some("Zeitgl\u00F6cklein des Lebens und Leidens Christi"),
comment = None,
textValueType = TextValueType.UnformattedText,
),
valueIri = "http://rdfh.ch/0803/ff17e5ef9601/values/d9a522845006",
permissions =
Expand Down Expand Up @@ -512,6 +516,7 @@ class ConstructResponseUtilV2SpecFullData(implicit stringFormatter: StringFormat
ontologySchema = InternalSchema,
maybeValueHasString = Some("Zeitgl\u00F6cklein des Lebens und Leidens Christi"),
comment = None,
textValueType = TextValueType.UnformattedText,
),
valueIri = "http://rdfh.ch/0803/c5058f3a/values/c3295339",
permissions =
Expand Down Expand Up @@ -592,6 +597,7 @@ class ConstructResponseUtilV2SpecFullData(implicit stringFormatter: StringFormat
ontologySchema = InternalSchema,
maybeValueHasString = Some("Zeitgl\u00F6cklein des Lebens und Leidens Christi"),
comment = None,
textValueType = TextValueType.UnformattedText,
),
valueIri = "http://rdfh.ch/0803/c5058f3a/values/c3295339",
permissions =
Expand Down Expand Up @@ -707,6 +713,7 @@ class ConstructResponseUtilV2SpecFullData(implicit stringFormatter: StringFormat
ontologySchema = InternalSchema,
maybeValueHasString = Some("Zeitgl\u00F6cklein des Lebens und Leidens Christi"),
comment = None,
textValueType = TextValueType.UnformattedText,
),
valueIri = "http://rdfh.ch/0803/ff17e5ef9601/values/d9a522845006",
permissions =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import org.knora.webapi.messages.v2.responder.SuccessResponseV2
import org.knora.webapi.messages.v2.responder.resourcemessages.*
import org.knora.webapi.messages.v2.responder.standoffmessages.*
import org.knora.webapi.messages.v2.responder.valuemessages.*
import org.knora.webapi.messages.v2.responder.valuemessages.TextValueType
import org.knora.webapi.models.filemodels.*
import org.knora.webapi.responders.v2.ResourcesResponseCheckerV2.compareReadResourcesSequenceV2Response
import org.knora.webapi.routing.UnsafeZioRun
Expand Down Expand Up @@ -984,6 +985,7 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {
valueContent = TextValueContentV2(
ontologySchema = ApiV2Complex,
maybeValueHasString = Some("this is text without standoff"),
textValueType = TextValueType.UnformattedText,
),
),
),
Expand All @@ -995,6 +997,7 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {
standoff = sampleStandoff,
mappingIri = Some("http://rdfh.ch/standoff/mappings/StandardMapping"),
mapping = standardMapping,
textValueType = TextValueType.FormattedText,
),
),
),
Expand Down Expand Up @@ -1282,6 +1285,7 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {
valueContent = TextValueContentV2(
ontologySchema = ApiV2Complex,
maybeValueHasString = Some("test title"),
textValueType = TextValueType.UnformattedText,
),
),
),
Expand All @@ -1290,12 +1294,14 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {
valueContent = TextValueContentV2(
ontologySchema = ApiV2Complex,
maybeValueHasString = Some("test publoc 1"),
textValueType = TextValueType.UnformattedText,
),
),
CreateValueInNewResourceV2(
valueContent = TextValueContentV2(
ontologySchema = ApiV2Complex,
maybeValueHasString = Some("test publoc 2"),
textValueType = TextValueType.UnformattedText,
),
),
),
Expand Down Expand Up @@ -1329,6 +1335,7 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {
valueContent = TextValueContentV2(
ontologySchema = ApiV2Complex,
maybeValueHasString = Some("test title"),
textValueType = TextValueType.UnformattedText,
),
),
),
Expand All @@ -1337,6 +1344,7 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {
valueContent = TextValueContentV2(
ontologySchema = ApiV2Complex,
maybeValueHasString = Some("test pagenum"),
textValueType = TextValueType.UnformattedText,
),
),
),
Expand Down Expand Up @@ -1370,18 +1378,21 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {
valueContent = TextValueContentV2(
ontologySchema = ApiV2Complex,
maybeValueHasString = Some("test title 1"),
textValueType = TextValueType.UnformattedText,
),
),
CreateValueInNewResourceV2(
valueContent = TextValueContentV2(
ontologySchema = ApiV2Complex,
maybeValueHasString = Some("test title 2"),
textValueType = TextValueType.UnformattedText,
),
),
CreateValueInNewResourceV2(
valueContent = TextValueContentV2(
ontologySchema = ApiV2Complex,
maybeValueHasString = Some("test title 1"),
textValueType = TextValueType.UnformattedText,
),
),
),
Expand Down Expand Up @@ -1415,6 +1426,7 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {
valueContent = TextValueContentV2(
ontologySchema = ApiV2Complex,
maybeValueHasString = Some("test title"),
textValueType = TextValueType.UnformattedText,
),
),
),
Expand Down Expand Up @@ -1520,6 +1532,7 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {
standoff = standoffWithInvalidLink,
mappingIri = Some("http://rdfh.ch/standoff/mappings/StandardMapping"),
mapping = standardMapping,
textValueType = TextValueType.FormattedText,
),
),
),
Expand Down Expand Up @@ -1588,6 +1601,7 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {
valueContent = TextValueContentV2(
ontologySchema = ApiV2Complex,
maybeValueHasString = Some("invalid text value"),
textValueType = TextValueType.UnformattedText,
),
),
),
Expand Down Expand Up @@ -2154,6 +2168,7 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {
standoff = sampleStandoffForErasingResource,
mappingIri = Some("http://rdfh.ch/standoff/mappings/StandardMapping"),
mapping = standardMapping,
textValueType = TextValueType.FormattedText,
),
),
),
Expand Down Expand Up @@ -2198,6 +2213,7 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {
standoff = Vector(sampleStandoffForErasingResource.head),
mappingIri = Some("http://rdfh.ch/standoff/mappings/StandardMapping"),
mapping = standardMapping,
textValueType = TextValueType.FormattedText,
),
),
anythingUserProfile,
Expand Down Expand Up @@ -2540,6 +2556,7 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender {
valueContent = TextValueContentV2(
ontologySchema = ApiV2Complex,
maybeValueHasString = Some(testValue),
textValueType = TextValueType.UnformattedText,
),
valueIri = Some(newValueIri.toSmartIri),
permissions = Some("CR knora-admin:Creator|V knora-admin:KnownUser"),
Expand Down
Loading

0 comments on commit 008fa98

Please sign in to comment.