All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.zakadabar.lib.content.data.ContentOverviewQuery.kt Maven / Gradle / Ivy

There is a newer version: 2023.4.20
Show newest version
/*
 * Copyright © 2020-2021, Simplexion, Hungary and contributors. Use of this source code is governed by the Apache 2.0 license.
 */
package zakadabar.lib.content.data

import kotlinx.serialization.Serializable
import zakadabar.lib.i18n.data.LocaleBo
import zakadabar.core.data.BaseBo
import zakadabar.core.data.EntityId
import zakadabar.core.data.QueryBo
import zakadabar.core.data.QueryBoCompanion

/**
 * Get an overview of contents defined on the site.
 */
@Serializable
class ContentOverviewQuery: QueryBo {

    companion object : QueryBoCompanion(ContentBo.boNamespace)

    override suspend fun execute() = comm.query(this, serializer(), ContentOverview.serializer())

}

/**
 * Overview of contents.
 *
 * @param  locales   All locales known by the application.
 * @param  entries   List of master content entities.
 */
@Serializable
class ContentOverview(
    val locales : List,
    val entries : List
): BaseBo

/**
 * Represents a master content entity.
 *
 * @param   id             Id of the master content entity.
 * @param   parent         Title of the parent master entity.
 * @param   path           Path to this master entity.
 * @param   status         Status of the master entity.
 * @param   localizations  A list of localized versions or null if there is no
 *                         localized version of the given locale. Entries of this
 *                         list are ordered the same as [Overview.locales].
 */
@Serializable
class ContentOverviewEntry(
    val id : EntityId,
    val parent: EntityId?,
    var path : String,
    val status: String,
    val localizations : List?>
) : BaseBo




© 2015 - 2025 Weber Informatics LLC | Privacy Policy