Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/main/kotlin/org/openmbee/flexo/mms/Layer1Context.kt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class Layer1Context<TRequestContext: GenericRequest, out TResponseContext: Gener
var commitId: String = transactionId
var lockId: String? = null
var branchId: String? = null
var defaultBranchId = DEFAULT_BRANCH_ID
var diffId: String? = null
var policyId: String? = null

Expand Down Expand Up @@ -181,6 +182,10 @@ class Layer1Context<TRequestContext: GenericRequest, out TResponseContext: Gener
} else true
} else false
}

fun defaultBranchId() {
defaultBranchId = call.parameters["defaultBranchId"]?: DEFAULT_BRANCH_ID
}
}


Expand Down Expand Up @@ -633,4 +638,4 @@ class Layer1Context<TRequestContext: GenericRequest, out TResponseContext: Gener
}
}
}
}
}
8 changes: 4 additions & 4 deletions src/main/kotlin/org/openmbee/flexo/mms/Namespaces.kt
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ fun prefixesFor(
object MMS {
private val BASE = SPARQL_PREFIXES["mms"]!!
val uri = BASE

private fun res(id: String): Resource {
return ResourceFactory.createResource("${BASE}${id}")
}
Expand Down Expand Up @@ -234,7 +234,7 @@ object MMS {

// object properties
val id = ResourceFactory.createProperty(BASE, "id")

private fun prop(id: String): Property {
return ResourceFactory.createProperty(BASE, id)
}
Expand All @@ -259,7 +259,7 @@ object MMS {
// access control properties
val implies = prop("implies")


val defaultBranchId = prop("defaultBranchId")
val srcRef = prop("srcRef")
val dstRef = prop("dstRef")

Expand Down Expand Up @@ -354,4 +354,4 @@ object MMS_URNS {
val pass = "$mms:pass"
val policy = "$mms:policy"
}
}
}
12 changes: 12 additions & 0 deletions src/main/kotlin/org/openmbee/flexo/mms/routes/Repos.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.openmbee.flexo.mms.routes

import io.ktor.http.*
import io.ktor.server.routing.*
import org.openmbee.flexo.mms.*
import org.openmbee.flexo.mms.server.linkedDataPlatformDirectContainer
Expand Down Expand Up @@ -39,6 +40,11 @@ fun Route.crudRepos() {
// set repo id on context
repoId = slug

// parse additional parameters; client may specify default branch ID
parsePathParams {
defaultBranchId()
}

// create new repo
createOrReplaceRepo()
}
Expand All @@ -65,6 +71,12 @@ fun Route.crudRepos() {

// create or replace repo
put {
// parse additional parameters; client may specify default branch ID
parsePathParams {
defaultBranchId()
}

// apply
createOrReplaceRepo()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,13 @@ suspend fun <TResponseContext: LdpMutateResponse> LdpDcLayer1Context<TResponseCo
setProperty(MMS.id, repoId!!)
setProperty(MMS.etag, transactionId)
setProperty(MMS.org, orgNode())
setProperty(MMS.defaultBranchId, defaultBranchId)
}
}
}

// set default branch
branchId = DEFAULT_BRANCH_ID
// set branch to create
branchId = defaultBranchId

// resolve ambiguity
if(intentIsAmbiguous) {
Expand Down