RecordSetSearchDoc.kt 5.2 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
/*
 * 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/>.
 */
18 19 20 21 22 23 24 25 26 27 28
package org.memobase.model

import com.fasterxml.jackson.annotation.JsonIgnore
import com.fasterxml.jackson.annotation.JsonInclude


@JsonInclude(JsonInclude.Include.NON_EMPTY)
data class RecordSetSearchDoc(
    @JsonIgnore
    val recordSetId: String,
    val isPublished: Boolean,
Jonas Waeber's avatar
Jonas Waeber committed
29
    val name: LanguageContainer,
30

Jonas Waeber's avatar
Jonas Waeber committed
31 32 33
    // Display
    val keyVisualLink: String,
    val numberOfDocuments: Int,
Jonas Waeber's avatar
Jonas Waeber committed
34
    val teaserTest: LanguageContainer,
35
    // Facets
36
    val documentType: List<FacetContainer>,
Jonas Waeber's avatar
Jonas Waeber committed
37
    val periodOfTimeAsYear: IntegerRange?,
38
    val supportedByMemoriav: Boolean,
Jonas Waeber's avatar
Jonas Waeber committed
39
    val languageOfMetadata: List<FacetContainer>,
40
    val institution: List<FacetContainer>,
41

42 43 44
    // Sort
    val lastUpdatedDate: String,

45
    // Search
Jonas Waeber's avatar
Jonas Waeber committed
46 47 48 49 50 51 52 53 54 55 56 57 58 59
    val scopeAndContent: LanguageContainer?,
    val accessMemobase: LanguageContainer?,
    val context: LanguageContainer?,
    val originalTitle: LanguageContainer?,
    val extent: LanguageContainer?,
    val selection: LanguageContainer?,
    val indexing: LanguageContainer?,
    val rights: LanguageContainer?,
    val description: LanguageContainer?,
    val access: LanguageContainer?,
    val project: LanguageContainer?,
    val relatedRecordSets: LanguageContainer?,
    val relatedPublications: LanguageContainer?,
    val relatedDocuments: LanguageContainer?,
60
    val dataImport: LanguageContainer?,
61 62
    val originalCallNumber: List<String>,
    val originalIdNUmber: List<String>,
63 64

    // Support Field (required to be indexed in the record).
65 66
    val originalInstitution: List<FacetContainer>,
    val masterInstitution: List<FacetContainer>,
67
    val accessInstitution: List<FacetContainer>
68 69 70
) : Schema(recordSetId) {

    companion object {
71 72
        const val lorem =
            "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
Jonas Waeber's avatar
Jonas Waeber committed
73
        const val placeholderTitle = "Placeholder Title"
74 75 76 77
        val DEFAULT = RecordSetSearchDoc(
            recordSetId = "NoRecordSetId",
            name = LanguageContainer.placeholder("TEST_RECORD_SET"),
            isPublished = false,
78 79 80 81 82 83 84
            documentType = listOf(
                FacetContainer(
                    LanguageContainer.placeholder("TEST DOCUMENT TYPE"),
                    filter = "",
                    facet = emptyList()
                )
            ),
85
            supportedByMemoriav = true,
86 87 88 89 90 91 92
            languageOfMetadata = listOf(
                FacetContainer(
                    LanguageContainer.placeholder("TEST LANGUAGE"),
                    filter = "",
                    facet = emptyList()
                )
            ),
93
            institution = emptyList(),
94
            periodOfTimeAsYear = IntegerRange(2000, 2020),
95
            lastUpdatedDate = "2020-11-20T10:29:01.128",
96
            keyVisualLink = "https://mb-wf1.memobase.unibas.ch/sites/default/files/styles/teaser/public/2020-10/1.jpg?itok=5ncVBnVQ",
Jonas Waeber's avatar
Jonas Waeber committed
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
            numberOfDocuments = 100,
            scopeAndContent = LanguageContainer.placeholder(lorem),
            accessMemobase = LanguageContainer.placeholder(lorem),
            context = LanguageContainer.placeholder(lorem),
            originalTitle = LanguageContainer.placeholder(placeholderTitle),
            extent = LanguageContainer.placeholder(lorem),
            selection = LanguageContainer.placeholder(lorem),
            indexing = LanguageContainer.placeholder(lorem),
            rights = LanguageContainer.placeholder(lorem),
            description = LanguageContainer.placeholder(lorem),
            access = LanguageContainer.placeholder(lorem),
            project = LanguageContainer.placeholder(placeholderTitle),
            relatedRecordSets = LanguageContainer.placeholder(placeholderTitle),
            relatedPublications = LanguageContainer.placeholder(placeholderTitle),
            relatedDocuments = LanguageContainer.placeholder(placeholderTitle),
112
            dataImport = LanguageContainer.placeholder(lorem),
Jonas Waeber's avatar
Jonas Waeber committed
113
            accessInstitution = emptyList(),
114 115 116 117 118
            teaserTest = LanguageContainer.placeholder(lorem),
            masterInstitution = emptyList(),
            originalCallNumber = emptyList(),
            originalInstitution = emptyList(),
            originalIdNUmber = emptyList()
119 120 121
        )
    }
}