2 * Copyright (C) 2023 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
9 package eu
.etaxonomy
.cdm
.api
.dto
.portal
.config
;
11 import java
.io
.Serializable
;
12 import java
.util
.ArrayList
;
13 import java
.util
.Arrays
;
14 import java
.util
.EnumSet
;
15 import java
.util
.HashMap
;
16 import java
.util
.HashSet
;
17 import java
.util
.List
;
18 import java
.util
.Locale
;
21 import java
.util
.UUID
;
23 import eu
.etaxonomy
.cdm
.api
.filter
.TaxonOccurrenceRelationType
;
24 import eu
.etaxonomy
.cdm
.model
.common
.AnnotationType
;
25 import eu
.etaxonomy
.cdm
.model
.reference
.OriginalSourceType
;
26 import eu
.etaxonomy
.cdm
.model
.term
.IdentifierType
;
32 public class TaxonPageDtoConfiguration
implements ISourceableLoaderConfiguration
, Serializable
{
34 private static final long serialVersionUID
= -3017154740995350103L;
36 //TODO should this be part of the configuration??
37 private UUID taxonUuid
;
39 private boolean useDtoLoading
= false;
42 private boolean withFacts
= true;
43 private boolean withSynonyms
= true;
44 private boolean withSpecimens
= true;
45 private boolean withKeys
= true;
46 private boolean withMedia
= true;
47 private boolean withTaxonNodes
= true;
49 private boolean includeUnpublished
= false;
51 private EnumSet
<TaxonOccurrenceRelationType
> specimenAssociationFilter
;
53 private Set
<UUID
> annotationTypes
= new HashSet
<>(
54 Arrays
.asList(new UUID
[] {AnnotationType
.uuidEditorial
}));
55 private Set
<UUID
> markerTypes
= new HashSet
<>();
56 private Set
<UUID
> identifierTypes
= new HashSet
<>(Arrays
.asList(new UUID
[] {IdentifierType
.uuidWfoNameIdentifier
}));
58 private Set
<UUID
> directNameRelTyes
= null;
59 private Set
<UUID
> inverseNameRelTyes
= null;
64 //should withSynonyms includeProparte and misapplications
65 // => yes as long as there are no specific parameters in dataportals to handle them differently
66 private boolean withTaxonRelationships
= true;
67 private UUID taxonRelationshipTypeTree
= null;
70 private UUID featureTree
= null;
71 private DistributionInfoConfiguration distributionInfoConfiguration
= new DistributionInfoConfiguration();
73 private Map
<UUID
,DistributionInfoConfiguration
> perFeatureDistributionInfoConfiguration
= new HashMap
<>();
76 private EnumSet
<OriginalSourceType
> sourceTypes
= OriginalSourceType
.allPublicTypes();
79 private List
<Locale
> locales
= new ArrayList
<>(); //is this data or formatting??
81 private Integer etAlPosition
;
84 // ******************************* GETTER / SETTER ***********************************/
86 public DistributionInfoConfiguration
getDistributionInfoConfiguration() {
87 return distributionInfoConfiguration
;
89 public void setDistributionInfoConfiguration(DistributionInfoConfiguration distributionInfoConfiguration
) {
90 this.distributionInfoConfiguration
= distributionInfoConfiguration
;
93 public DistributionInfoConfiguration
putDistributionInfoConfiguration(UUID featureUuid
, DistributionInfoConfiguration config
) {
94 return perFeatureDistributionInfoConfiguration
.put(featureUuid
, config
);
96 public DistributionInfoConfiguration
getDistributionInfoConfiguration(UUID featureUuid
) {
97 DistributionInfoConfiguration result
= perFeatureDistributionInfoConfiguration
.get(featureUuid
);
99 result
= distributionInfoConfiguration
;
104 public UUID
getTaxonUuid() {
107 public void setTaxonUuid(UUID taxonUuid
) {
108 this.taxonUuid
= taxonUuid
;
111 public boolean isWithFacts() {
114 public void setWithFacts(boolean withFacts
) {
115 this.withFacts
= withFacts
;
118 public boolean isWithSynonyms() {
121 public void setWithSynonyms(boolean withSynonyms
) {
122 this.withSynonyms
= withSynonyms
;
125 public boolean isWithSpecimens() {
126 return withSpecimens
;
128 public void setWithSpecimens(boolean withSpecimens
) {
129 this.withSpecimens
= withSpecimens
;
132 public boolean isWithKeys() {
135 public void setWithKeys(boolean withKeys
) {
136 this.withKeys
= withKeys
;
139 public boolean isWithMedia() {
142 public void setWithMedia(boolean withMedia
) {
143 this.withMedia
= withMedia
;
146 public boolean isWithTaxonNodes() {
147 return withTaxonNodes
;
149 public void setWithTaxonNodes(boolean withTaxonNodes
) {
150 this.withTaxonNodes
= withTaxonNodes
;
152 public boolean isWithTaxonRelationships() {
153 return withTaxonRelationships
;
155 public void setWithTaxonRelationships(boolean withTaxonRelationships
) {
156 this.withTaxonRelationships
= withTaxonRelationships
;
158 public UUID
getTaxonRelationshipTypeTree() {
159 return taxonRelationshipTypeTree
;
161 public void setTaxonRelationshipTypeTree(UUID taxonRelationshipTypeTree
) {
162 this.taxonRelationshipTypeTree
= taxonRelationshipTypeTree
;
165 public UUID
getFeatureTree() {
168 public void setFeatureTree(UUID featureTree
) {
169 this.featureTree
= featureTree
;
172 public List
<Locale
> getLocales() {
175 public void setLocales(List
<Locale
> locales
) {
176 this.locales
= locales
;
179 public Integer
getEtAlPosition() {
182 public void setEtAlPosition(Integer etAlPosition
) {
183 this.etAlPosition
= etAlPosition
;
186 public boolean isIncludeUnpublished() {
187 return includeUnpublished
;
189 public void setIncludeUnpublished(boolean includeUnpublished
) {
190 this.includeUnpublished
= includeUnpublished
;
193 public EnumSet
<TaxonOccurrenceRelationType
> getSpecimenAssociationFilter() {
194 return specimenAssociationFilter
;
196 public void setSpecimenAssociationFilter(EnumSet
<TaxonOccurrenceRelationType
> specimenAssociationFilter
) {
197 this.specimenAssociationFilter
= specimenAssociationFilter
;
201 public EnumSet
<OriginalSourceType
> getSourceTypes() {
204 public void setSourceTypes(EnumSet
<OriginalSourceType
> sourceTypes
) {
205 this.sourceTypes
= sourceTypes
;
206 this.distributionInfoConfiguration
.setSourceTypes(sourceTypes
);
210 public Set
<UUID
> getMarkerTypes() {
214 * Note: this method also sets the marker type filter
215 * for the included distributionInfoConfiguration. If the latter
216 * needs a separate filter this has to be set afterwards.
218 public void setMarkerTypes(Set
<UUID
> markerTypes
) {
219 this.markerTypes
= markerTypes
;
220 this.distributionInfoConfiguration
.setMarkerTypes(markerTypes
);
224 public Set
<UUID
> getAnnotationTypes() {
225 return annotationTypes
;
228 * Note: this method also sets the annotation type filter
229 * for the included distributionInfoConfiguration. If the latter
230 * needs a separate filter this has to be set afterwards.
232 public void setAnnotationTypes(Set
<UUID
> annotationTypes
) {
233 this.annotationTypes
= annotationTypes
;
234 this.distributionInfoConfiguration
.setAnnotationTypes(annotationTypes
);
236 public void addAnnotationType(UUID annotationType
) {
237 if (this.annotationTypes
== null) {
238 this.annotationTypes
= new HashSet
<>();
240 this.annotationTypes
.add(annotationType
);
241 this.distributionInfoConfiguration
.addAnnotationType(annotationType
);
245 public Set
<UUID
> getIdentifierTypes() {
246 return identifierTypes
;
249 //name relationship types
250 public Set
<UUID
> getDirectNameRelTyes() {
251 return directNameRelTyes
;
253 public void setDirectNameRelTyes(Set
<UUID
> directNameRelTyes
) {
254 this.directNameRelTyes
= directNameRelTyes
;
257 public Set
<UUID
> getInverseNameRelTyes() {
258 return inverseNameRelTyes
;
260 public void setInverseNameRelTyes(Set
<UUID
> inverseNameRelTyes
) {
261 this.inverseNameRelTyes
= inverseNameRelTyes
;
264 public boolean isUseDtoLoading() {
265 return useDtoLoading
;
267 public void setUseDtoLoading(boolean useDtoLoading
) {
268 this.useDtoLoading
= useDtoLoading
;