Commit c2b40a35 authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Code style changes

parent e50042a0
...@@ -31,13 +31,13 @@ import org.memobase.builders.PersonFacetBuilder ...@@ -31,13 +31,13 @@ import org.memobase.builders.PersonFacetBuilder
import org.memobase.builders.PlaceFacetBuilder import org.memobase.builders.PlaceFacetBuilder
import org.memobase.builders.SuggestContainerBuilder import org.memobase.builders.SuggestContainerBuilder
import org.memobase.helpers.AspectRatio import org.memobase.helpers.AspectRatio
import org.memobase.helpers.Constants
import org.memobase.helpers.ElasticSearchWrapper import org.memobase.helpers.ElasticSearchWrapper
import org.memobase.helpers.Extract import org.memobase.helpers.Extract
import org.memobase.helpers.FacetBuildHelpers import org.memobase.helpers.FacetBuildHelpers
import org.memobase.helpers.Filter import org.memobase.helpers.Filter
import org.memobase.helpers.InstitutionAndRecordSetExtractionHelper.extractInstitution import org.memobase.helpers.InstitutionAndRecordSetExtractionHelper.extractInstitution
import org.memobase.helpers.InstitutionAndRecordSetExtractionHelper.extractRecordSet import org.memobase.helpers.InstitutionAndRecordSetExtractionHelper.extractRecordSet
import org.memobase.helpers.Constants
import org.memobase.helpers.JsonUtility import org.memobase.helpers.JsonUtility
import org.memobase.helpers.TranslationMappers import org.memobase.helpers.TranslationMappers
import org.memobase.model.DocumentsSearchDoc import org.memobase.model.DocumentsSearchDoc
...@@ -57,9 +57,11 @@ class DocumentsSearchDocBuilder( ...@@ -57,9 +57,11 @@ class DocumentsSearchDocBuilder(
val record = input[JsonUtility.recordTag] ?: throw InvalidInputException("No record defined in the message.") val record = input[JsonUtility.recordTag] ?: throw InvalidInputException("No record defined in the message.")
val digitalObject = val digitalObject =
input.values.firstOrNull { it[Constants.atType] == RICO.Instantiation.uri && it[RICO.type.localName] == RICO.Types.Instantiation.digitalObject } input.values.firstOrNull { it[Constants.atType] == RICO.Instantiation.uri
&& it[RICO.type.localName] == RICO.Types.Instantiation.digitalObject }
val physicalObject = val physicalObject =
input.values.firstOrNull { it[Constants.atType] == RICO.Instantiation.uri && it[RICO.type.localName] == RICO.Types.Instantiation.physicalObject } input.values.firstOrNull { it[Constants.atType] == RICO.Instantiation.uri
&& it[RICO.type.localName] == RICO.Types.Instantiation.physicalObject }
val keywordIds = Extract.identifiers(record[Constants.hasSubject]) val keywordIds = Extract.identifiers(record[Constants.hasSubject])
val genreIds = Extract.identifiers(record[Constants.hasGenre]) val genreIds = Extract.identifiers(record[Constants.hasGenre])
...@@ -75,7 +77,8 @@ class DocumentsSearchDocBuilder( ...@@ -75,7 +77,8 @@ class DocumentsSearchDocBuilder(
val subjectPersonBuilder = AgentContainerBuilder(keywordIds, Constants.Person, null, input) val subjectPersonBuilder = AgentContainerBuilder(keywordIds, Constants.Person, null, input)
val publisherPersonBuilder = AgentContainerBuilder(publishedByIds, Constants.Person, null, input) val publisherPersonBuilder = AgentContainerBuilder(publishedByIds, Constants.Person, null, input)
val producersPersonBuilder = AgentContainerBuilder(producerIds, Constants.Person, null, input) val producersPersonBuilder = AgentContainerBuilder(producerIds, Constants.Person, null, input)
val contributorPersonBuilder = AgentContainerBuilder(emptyList(), Constants.Person, Constants.contributor, input) val contributorPersonBuilder =
AgentContainerBuilder(emptyList(), Constants.Person, Constants.contributor, input)
val creatorPersonBuilder = AgentContainerBuilder(emptyList(), Constants.Person, Constants.creator, input) val creatorPersonBuilder = AgentContainerBuilder(emptyList(), Constants.Person, Constants.creator, input)
val subjectCorporateBodyBuilder = AgentContainerBuilder(keywordIds, Constants.CorporateBody, null, input) val subjectCorporateBodyBuilder = AgentContainerBuilder(keywordIds, Constants.CorporateBody, null, input)
...@@ -83,7 +86,8 @@ class DocumentsSearchDocBuilder( ...@@ -83,7 +86,8 @@ class DocumentsSearchDocBuilder(
val producersCorporateBodyBuilder = AgentContainerBuilder(producerIds, Constants.CorporateBody, null, input) val producersCorporateBodyBuilder = AgentContainerBuilder(producerIds, Constants.CorporateBody, null, input)
val contributorCorporateBodyBuilder = val contributorCorporateBodyBuilder =
AgentContainerBuilder(emptyList(), Constants.CorporateBody, Constants.contributor, input) AgentContainerBuilder(emptyList(), Constants.CorporateBody, Constants.contributor, input)
val creatorCorporateBodyBuilder = AgentContainerBuilder(emptyList(), Constants.CorporateBody, Constants.creator, input) val creatorCorporateBodyBuilder =
AgentContainerBuilder(emptyList(), Constants.CorporateBody, Constants.creator, input)
val subjectAgentBuilder = AgentContainerBuilder(keywordIds, Constants.Agent, null, input) val subjectAgentBuilder = AgentContainerBuilder(keywordIds, Constants.Agent, null, input)
val publisherAgentBuilder = AgentContainerBuilder(publishedByIds, Constants.Agent, null, input) val publisherAgentBuilder = AgentContainerBuilder(publishedByIds, Constants.Agent, null, input)
...@@ -91,7 +95,8 @@ class DocumentsSearchDocBuilder( ...@@ -91,7 +95,8 @@ class DocumentsSearchDocBuilder(
val contributorAgentBuilder = AgentContainerBuilder(emptyList(), Constants.Agent, Constants.contributor, input) val contributorAgentBuilder = AgentContainerBuilder(emptyList(), Constants.Agent, Constants.contributor, input)
val creatorAgentBuilder = AgentContainerBuilder(emptyList(), Constants.Agent, Constants.creator, input) val creatorAgentBuilder = AgentContainerBuilder(emptyList(), Constants.Agent, Constants.creator, input)
val placesRelatedBuilder = FacettedContainerBuilder(spatialIds, Constants.Place, Constants.name, FacetBuildHelpers::place) val placesRelatedBuilder =
FacettedContainerBuilder(spatialIds, Constants.Place, Constants.name, FacetBuildHelpers::place)
val placeCapturedBuilder = val placeCapturedBuilder =
FacettedContainerBuilder(placeOfCaptureIds, Constants.Place, Constants.name, FacetBuildHelpers::place) FacettedContainerBuilder(placeOfCaptureIds, Constants.Place, Constants.name, FacetBuildHelpers::place)
......
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