11package org.ivdnt.galahad.documents
22
3+ import com.fasterxml.jackson.annotation.JsonIgnore
34import org.ivdnt.galahad.annotations.Annotation
45import org.ivdnt.galahad.annotations.LayerPreview
5- import org.ivdnt.galahad.annotations.LayerSummary
6+ import org.ivdnt.galahad.annotations.LayerAnnotations
67import org.ivdnt.galahad.formats.InternalFile
78
89data class DocumentMetadata (
@@ -15,12 +16,14 @@ data class DocumentMetadata(
1516 /* * A truncated preview of the annotated layer. */
1617 val preview : LayerPreview ,
1718 /* * Some statistics about the source annotations, if present */
18- val summary : LayerSummary ,
19+ val annotations : LayerAnnotations ,
1920 /* * Last modified timestamp in milliseconds. */
2021 val modified : Long ,
21- /* * Annotation types in the source layer. */
22- val annotations : Set <Annotation >,
2322) {
23+ @get:JsonIgnore
24+ val annotationSet: List <Annotation >
25+ get() = annotations.annotations.map { it.key }
26+
2427 companion object {
2528 private const val PREVIEW_LENGTH : Int = 100
2629
@@ -31,9 +34,8 @@ data class DocumentMetadata(
3134 format = file.format,
3235 text = text.take(PREVIEW_LENGTH ) + if (text.length > PREVIEW_LENGTH ) " ..." else " " ,
3336 preview = file.layer.preview,
34- summary = file.layer.summary,
37+ annotations = file.layer.summary,
3538 modified = System .currentTimeMillis(),
36- annotations = file.layer.annotations
3739 )
3840 }
3941 }
0 commit comments