public class DescriptionUtility
extends java.lang.Object
Constructor and Description |
---|
DescriptionUtility() |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkAreaMarkedHidden(java.util.Set<MarkerType> hiddenAreaMarkerTypes,
NamedArea area) |
static java.util.Set<Distribution> |
filterDistributions(java.util.Collection<Distribution> distributions,
java.util.Set<MarkerType> hiddenAreaMarkerTypes,
boolean preferComputed,
boolean statusOrderPreference,
boolean subAreaPreference)
NOTE: To avoid LayzyLoadingExceptions this method must be used in a transactional context.
Filters the given set of
Distribution s for publication purposes
The following rules are respected during the filtering:
Marked area filter: Skip distributions for areas having a TRUE Marker
with one of the specified MarkerType s. |
static DistributionTree |
orderDistributions(IDefinedTermDao termDao,
java.util.Set<NamedAreaLevel> omitLevels,
java.util.Collection<Distribution> distributions,
java.util.Set<MarkerType> hiddenAreaMarkerTypes,
DistributionOrder distributionOrder)
Orders the given Distribution elements in a hierarchical structure.
|
public static java.util.Set<Distribution> filterDistributions(java.util.Collection<Distribution> distributions, java.util.Set<MarkerType> hiddenAreaMarkerTypes, boolean preferComputed, boolean statusOrderPreference, boolean subAreaPreference)
Distribution
s for publication purposes
The following rules are respected during the filtering:
TRUE
Marker
with one of the specified MarkerType
s. Existing sub-areas of a marked area must also be marked
with the same marker type, otherwise the marked area acts as a fallback area for the sub areas.
An area is a fallback area if it is marked to be hidden and if it has at least one of
sub area which is not marked to be hidden. The fallback area will be show if there is no Distribution
for any of the non hidden sub-areas. For more detailed discussion on fallback areas see
https://dev.e-taxonomy.eu/trac/ticket/4408MarkerType.COMPUTED()
). This means if a entered or imported status
information exist for the same area for which computed data is available,
the computed data has to be given preference over other data.
see parameter preferComputed
PresenceAbsenceTermBase
) for the same area the status
with the highest order is preferred, see
OrderedTermBase.compareTo(OrderedTermBase)
. This rule is
optional, see parameter statusOrderPreference
subAreaPreference
. Can be run separately from the other filters.
This rule affects any distribution,
that is to computed and edited equally. For more details see
https://dev.e-taxonomy.eu/trac/ticket/5050
)distributions
- the distributions to filterhiddenAreaMarkerTypes
- distributions where the area has a Marker
with one of the specified MarkerType
s will
be skipped or acts as fall back area. For more details see Marked area filter above.preferComputed
- Computed distributions for the same area will be preferred over edited distributions.
This parameter should always be set to true
.statusOrderPreference
- enables the Status order preference rule if set to true,
This rule can be run separately from the other filters.subAreaPreference
- enables the Sub area preference rule if set to truepublic static boolean checkAreaMarkedHidden(java.util.Set<MarkerType> hiddenAreaMarkerTypes, NamedArea area)
public static DistributionTree orderDistributions(IDefinedTermDao termDao, java.util.Set<NamedAreaLevel> omitLevels, java.util.Collection<Distribution> distributions, java.util.Set<MarkerType> hiddenAreaMarkerTypes, DistributionOrder distributionOrder)
termDao
- omitLevels
- hiddenAreaMarkerTypes
- Areas not associated to a Distribution in the distList
are detected as fall back area
if they are having a Marker
with one of the specified MarkerType
s. Areas identified as such
are omitted from the hierarchy and the sub areas are moving one level up.
For more details on fall back areas see Marked area filter of
filterDistributions(Collection, Set, boolean, boolean, boolean)
.distributionOrder
- distList
- Copyright © 2007-2020 EDIT. All Rights Reserved.