RecordSetSearchDoc.kt 3.08 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
29
30
31
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 name: LanguageContainer,
    val isPublished: Boolean,

    // Facets
32
    val documentType: List<FacetContainer>,
33
    val supportedByMemoriav: Boolean,
Jonas Waeber's avatar
Jonas Waeber committed
34
    val languageOfMetadata: List<FacetContainer>,
35
    val institution: FacetContainer,
36
    val periodOfTimeAsYear: IntegerRange,
37

38
39
40
    // Sort
    val lastUpdatedDate: String,

41
    // Search
42
43
44
    val scopeAndContent: LanguageContainer,

    // Display
45
46
    val keyVisualLink: String,
    val numberOfDocuments: Int
47
48
49
50
51
52
53
) : Schema(recordSetId) {

    companion object {
        val DEFAULT = RecordSetSearchDoc(
            recordSetId = "NoRecordSetId",
            name = LanguageContainer.placeholder("TEST_RECORD_SET"),
            isPublished = false,
54
            documentType = listOf(FacetContainer(
55
56
57
                LanguageContainer.placeholder("TEST DOCUMENT TYPE"),
                filter = "",
                facet = emptyList()
58
            )),
59
            supportedByMemoriav = true,
Jonas Waeber's avatar
Jonas Waeber committed
60
            languageOfMetadata = listOf(FacetContainer(
61
62
63
                LanguageContainer.placeholder("TEST LANGUAGE"),
                filter = "",
                facet = emptyList()
Jonas Waeber's avatar
Jonas Waeber committed
64
            )),
65
66
            institution = FacetContainer(
                LanguageContainer.placeholder("TEST INSTITUTION"),
67
                filter = "INSTITUTION_IDENTIFIER",
68
69
                facet = emptyList()
            ),
70
            periodOfTimeAsYear = IntegerRange(2000, 2020),
71
72
            scopeAndContent = LanguageContainer.placeholder("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."),
            lastUpdatedDate = "2020-11-20T10:29:01.128",
73
74
            keyVisualLink = "https://mb-wf1.memobase.unibas.ch/sites/default/files/styles/teaser/public/2020-10/1.jpg?itok=5ncVBnVQ",
            numberOfDocuments = 100
75
76
77
        )
    }
}