Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ sealed class DeployClient(
protected val output: InspireOutput,
) {
protected val logger = LoggerFactory.getLogger(this::class.java)!!
protected val deploymentId = Uuid.random()
protected val deploymentTimestamp = Clock.System.now()
val postProcessors: MutableList<(DeploymentResult) -> Unit> = mutableListOf()

init {
Expand Down Expand Up @@ -135,6 +133,9 @@ sealed class DeployClient(
}

fun deployStyles() {
val deploymentId = Uuid.random()
val deploymentTimestamp = Clock.System.now()

val textStyles = textStyleRepository.listAllModel().filter { it.definition is TextStyleDefinitionModel }
val paragraphStyles =
paragraphStyleRepository.listAllModel().filter { it.definition is ParagraphStyleDefinitionModel }
Expand Down Expand Up @@ -256,7 +257,7 @@ sealed class DeployClient(
return deployOrder
}

protected fun deployImages(documentObjects: List<DocumentObjectModel>): DeploymentResult {
protected fun deployImages(documentObjects: List<DocumentObjectModel>, deploymentId: Uuid, deploymentTimestamp: Instant): DeploymentResult {
val deploymentResult = DeploymentResult(deploymentId)

val uniqueImageRefs = documentObjects.flatMap {
Expand Down Expand Up @@ -408,7 +409,7 @@ sealed class DeployClient(
fun progressReportInternal(objects: List<DocumentObjectModel>, deployId: Uuid? = null): ProgressReport {
val lastDeployment = deployId?.let { LastDeployment(it, Clock.System.now()) } ?: getLastDeployEvent()

val report = ProgressReport(deploymentId, mutableMapOf())
val report = ProgressReport(deployId ?: Uuid.random(), mutableMapOf())

val queue: MutableList<RefModel> = mutableListOf()
val alreadyVisitedRefs = mutableSetOf<Pair<String, KClass<*>>>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ class DesignerDeployClient(
}

override fun deployDocumentObjectsInternal(documentObjects: List<DocumentObjectModel>): DeploymentResult {
val deploymentId = kotlin.uuid.Uuid.random()
val deploymentTimestamp = kotlinx.datetime.Clock.System.now()
val deploymentResult = DeploymentResult(deploymentId)

val orderedDocumentObject = deployOrder(documentObjects)
deploymentResult += deployImages(orderedDocumentObject)
deploymentResult += deployImages(orderedDocumentObject, deploymentId, deploymentTimestamp)

for (it in orderedDocumentObject) {
val targetPath = documentObjectBuilder.getDocumentObjectPath(it)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,13 @@ class InteractiveDeployClient(
}

override fun deployDocumentObjectsInternal(documentObjects: List<DocumentObjectModel>): DeploymentResult {
val deploymentId = kotlin.uuid.Uuid.random()
val deploymentTimestamp = kotlinx.datetime.Clock.System.now()
val deploymentResult = DeploymentResult(deploymentId)

val orderedDocumentObject = deployOrder(documentObjects)

deploymentResult += deployImages(orderedDocumentObject)
deploymentResult += deployImages(orderedDocumentObject, deploymentId, deploymentTimestamp)

for (it in orderedDocumentObject) {
val targetPath = documentObjectBuilder.getDocumentObjectPath(it)
Expand Down