DocumentsSearchDoc.kt 6.24 KB
Newer Older
Jonas Waeber's avatar
Jonas Waeber committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
/*
 * search-doc-service
 * Copyright (C) 2020 Memoriav
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

package org.memobase.model

21
import com.fasterxml.jackson.annotation.JsonIgnore
Jonas Waeber's avatar
Jonas Waeber committed
22
import com.fasterxml.jackson.annotation.JsonInclude
23
import org.memobase.model.SimpleFacetContainer.Companion
Jonas Waeber's avatar
Jonas Waeber committed
24 25

@JsonInclude(JsonInclude.Include.NON_EMPTY)
26
data class DocumentsSearchDoc(
Jonas Waeber's avatar
Jonas Waeber committed
27 28 29 30 31 32
    // Titles
    val title: List<LanguageContainer>,
    val seriesTitle: List<LanguageContainer>,
    val broadcastTitle: List<LanguageContainer>,

    // Datatype properties
33
    val type: FacetContainer,
Jonas Waeber's avatar
Jonas Waeber committed
34
    val sourceID: String,
35 36
    @JsonIgnore
    private val recordId: String,
Jonas Waeber's avatar
Jonas Waeber committed
37 38 39 40 41 42
    val abstract: List<LanguageContainer>,
    val descriptiveNote: List<LanguageContainer>,
    val scopeAndContent: List<LanguageContainer>,
    val source: List<LanguageContainer>,
    val relatedMaterial: List<LanguageContainer>,
    val rightsHolder: List<LanguageContainer>,
43
    val conditionsOfUse: List<LanguageContainer>,
Jonas Waeber's avatar
Jonas Waeber committed
44 45 46
    val sameAs: List<String>,

    // Concepts
47 48 49 50
    val format: List<EnrichedFacetContainer>,
    val genre: List<EnrichedFacetContainer>,
    val language: List<EnrichedFacetContainer>,
    val keywords: LanguageContainer,
Jonas Waeber's avatar
Jonas Waeber committed
51 52

    // Agents
53 54 55 56 57
    val personSubject: List<AgentWithRelationContainer>,
    val personCreator: List<AgentWithRelationContainer>,
    val personContributor: List<AgentWithRelationContainer>,
    val personPublisher: List<AgentWithRelationContainer>,
    val personProducer: List<AgentWithRelationContainer>,
58
    val personsFacet: SimpleFacetContainer,
Jonas Waeber's avatar
Jonas Waeber committed
59

60 61 62 63 64
    val corporateBodySubject: List<AgentWithRelationContainer>,
    val corporateBodyCreator: List<AgentWithRelationContainer>,
    val corporateBodyContributor: List<AgentWithRelationContainer>,
    val corporateBodyPublisher: List<AgentWithRelationContainer>,
    val corporateBodyProducer: List<AgentWithRelationContainer>,
Jonas Waeber's avatar
Jonas Waeber committed
65

66 67 68 69 70
    val agentSubject: List<AgentWithRelationContainer>,
    val agentCreator: List<AgentWithRelationContainer>,
    val agentContributor: List<AgentWithRelationContainer>,
    val agentPublisher: List<AgentWithRelationContainer>,
    val agentProducer: List<AgentWithRelationContainer>,
Jonas Waeber's avatar
Jonas Waeber committed
71 72

    // Places
Jonas Waeber's avatar
Jonas Waeber committed
73 74
    val placeRelated: List<FacetContainer>,
    val placeCapture: List<FacetContainer>,
75
    val placeFacet: SimpleFacetContainer,
Jonas Waeber's avatar
Jonas Waeber committed
76 77 78 79 80 81

    // Dates
    val temporal: List<DateContainer>,
    val dateCreated: List<DateContainer>,
    val dateIssued: List<DateContainer>,

82
    // Relations
Jonas Waeber's avatar
Jonas Waeber committed
83 84
    val institution: List<FacetContainer>,
    val recordSet: FacetContainer,
Jonas Waeber's avatar
Jonas Waeber committed
85

86 87 88 89 90
    val memoriavClaim: Boolean,

    // Digital Object
    val durationDigital: List<String>,
    val colourDigital: List<String>,
91
    val locator: String,
92
    val accessDigital: List<FacetContainer>,
93
    val usageDigital: List<String>,
94
    val usageDigitalGroup: List<FacetContainer>,
95 96 97
    val digitalObjectNote: List<LanguageContainer>,
    val usageConditionsDigital: List<LanguageContainer>,

Jonas Waeber's avatar
Jonas Waeber committed
98 99 100
    // enriched from digital object
    val digital: EnrichedDigitalMetadata,

101 102 103
    // Physical Object
    val durationPhysical: List<String>,
    val callNumber: List<String>,
104
    val accessPhysical: List<FacetContainer>,
105 106 107 108 109 110
    val usagePhysical: List<String>,
    val physicalCharacteristics: List<LanguageContainer>,
    val colourPhysical: List<LanguageContainer>,
    val usageConditionsPhysical: List<LanguageContainer>,
    val physicalObjectNote: List<LanguageContainer>,

111 112
    // Combined Physical & Digital
    val access: List<FacetContainer>,
Jonas Waeber's avatar
Jonas Waeber committed
113

Jonas Waeber's avatar
Jonas Waeber committed
114 115 116
    // internal fields
    val published: Boolean,

Jonas Waeber's avatar
Jonas Waeber committed
117 118
    // auto complete source
    val suggest: SuggestContainer
119 120 121
) : Schema(recordId) {

    companion object {
122 123 124
        private val otherDocumentTypeLanguageContainer =
            LanguageContainer(listOf("Andere"), listOf("Autres"), listOf("Altri"), emptyList())

125 126 127 128
        val DEFAULT = DocumentsSearchDoc(
            emptyList(),
            emptyList(),
            emptyList(),
129 130
            FacetContainer(
                otherDocumentTypeLanguageContainer,
131
                "Andere",
132 133
                emptyList()
            ),
134
            "NoSourceIdFound",
Jonas Waeber's avatar
Jonas Waeber committed
135
            "TestIdentifier",
136 137 138 139 140 141 142 143 144 145
            emptyList(),
            emptyList(),
            emptyList(),
            emptyList(),
            emptyList(),
            emptyList(),
            emptyList(),
            emptyList(),
            emptyList(),
            emptyList(),
146
            emptyList(),
147
            LanguageContainer.EMPTY,
148 149 150 151 152
            emptyList(),
            emptyList(),
            emptyList(),
            emptyList(),
            emptyList(),
153
            SimpleFacetContainer.EMPTY,
154 155 156 157 158 159 160 161 162 163 164 165
            emptyList(),
            emptyList(),
            emptyList(),
            emptyList(),
            emptyList(),
            emptyList(),
            emptyList(),
            emptyList(),
            emptyList(),
            emptyList(),
            emptyList(),
            emptyList(),
166
            SimpleFacetContainer.EMPTY,
167 168 169
            emptyList(),
            emptyList(),
            emptyList(),
Jonas Waeber's avatar
Jonas Waeber committed
170
            listOf(FacetContainer.placeholder("NoInstitutionInRecord")),
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
            FacetContainer.placeholder("NoRecordSetInRecord"),
            false,
            emptyList(),
            emptyList(),
            "",
            emptyList(),
            emptyList(),
            emptyList(),
            emptyList(),
            emptyList(),
            EnrichedDigitalMetadata(),
            emptyList(),
            emptyList(),
            emptyList(),
            emptyList(),
            emptyList(),
            emptyList(),
            emptyList(),
            emptyList(),
            emptyList(),
            false,
            SuggestContainer(emptyList(), emptyList(), emptyList(), emptyList())
        )
    }
}