Skip to content

Commit

Permalink
Don't handle the search views right now
Browse files Browse the repository at this point in the history
  • Loading branch information
olivergrabinski committed Apr 15, 2024
1 parent 2f677a8 commit ce572f4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 33 deletions.
1 change: 0 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,6 @@ lazy val ship = project
compositeViewsPlugin % "compile->compile",
elasticsearchPlugin % "compile->compile",
storagePlugin % "compile->compile;test->test",
searchPlugin % "compile->compile",
tests % "test->compile;test->test"
)
.settings(
Expand Down
5 changes: 0 additions & 5 deletions ship/src/main/resources/ship-default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ ship {
name = "Default Sparql view"
description = "A Sparql view of all resources in the project."
}

search {
name = "Default global search view"
description = "An Elasticsearch view of configured resources for the global search."
}
}

# Service account configuration for internal operations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import pureconfig.generic.semiauto.deriveReader

case class ViewDefaults(
elasticsearch: Defaults,
blazegraph: Defaults,
search: Defaults
blazegraph: Defaults
)

object ViewDefaults {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import ch.epfl.bluebrain.nexus.delta.plugins.compositeviews.CompositeViews
import ch.epfl.bluebrain.nexus.delta.plugins.compositeviews.model.CompositeViewEvent
import ch.epfl.bluebrain.nexus.delta.plugins.compositeviews.model.CompositeViewEvent._
import ch.epfl.bluebrain.nexus.delta.plugins.compositeviews.model.CompositeViewRejection.{IncorrectRev, ResourceAlreadyExists}
import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary.nxv
import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.api.JsonLdApi
import ch.epfl.bluebrain.nexus.delta.sdk.identities.model.Caller
import ch.epfl.bluebrain.nexus.delta.sdk.projects.FetchContext
Expand Down Expand Up @@ -38,31 +37,13 @@ class CompositeViewProcessor(views: UUID => IO[CompositeViews], projectMapper: P
implicit val c: Caller = Caller(s, Set.empty)
val cRev = event.rev - 1
val project = projectMapper.map(event.project)
val searchViewId = nxv + "searchView"

event match {
case e: CompositeViewCreated =>
e.id match {
case id if id == searchViewId => IO.unit // The search view is created upon project creation
case _ => views(event.uuid).flatMap(_.create(project, e.source))
}
case e: CompositeViewUpdated =>
e.id match {
case id if id == searchViewId => IO.unit
case _ => views(event.uuid).flatMap(_.update(e.id, project, cRev, e.source))
}
case e: CompositeViewDeprecated =>
e.id match {
case id if id == searchViewId => IO.unit
case _ => views(event.uuid).flatMap(_.deprecate(e.id, project, cRev))
}
case e: CompositeViewUndeprecated =>
e.id match {
case id if id == searchViewId => IO.unit
case _ => views(event.uuid).flatMap(_.undeprecate(e.id, project, cRev))
}
case _: CompositeViewTagAdded =>
IO.unit // TODO: Can/should we tag?
case e: CompositeViewCreated => views(event.uuid).flatMap(_.create(project, e.source))
case e: CompositeViewUpdated => views(event.uuid).flatMap(_.update(e.id, project, cRev, e.source))
case e: CompositeViewDeprecated => views(event.uuid).flatMap(_.deprecate(e.id, project, cRev))
case e: CompositeViewUndeprecated => views(event.uuid).flatMap(_.undeprecate(e.id, project, cRev))
case _: CompositeViewTagAdded => IO.unit // TODO: Can/should we tag?
}
}.redeemWith(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import ch.epfl.bluebrain.nexus.delta.sdk.resources.Resources
import ch.epfl.bluebrain.nexus.delta.sourcing.Transactors
import ch.epfl.bluebrain.nexus.delta.sourcing.model.EntityType
import ch.epfl.bluebrain.nexus.delta.sourcing.offset.Offset
import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.Doobie.{PostgresPassword, PostgresUser, transactors}
import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.Doobie.{transactors, PostgresPassword, PostgresUser}
import ch.epfl.bluebrain.nexus.ship.ImportReport.Count
import ch.epfl.bluebrain.nexus.ship.RunShipSuite.{checkFor, clearDB, expectedImportReport, getDistinctOrgProjects}
import ch.epfl.bluebrain.nexus.testkit.config.SystemPropertyOverride
Expand Down

0 comments on commit ce572f4

Please sign in to comment.