Class DiscoveryConfigurationService
java.lang.Object
org.dspace.discovery.configuration.DiscoveryConfigurationService
- Author:
- Kevin Van de Velde (kevin at atmire dot com)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the unique set of configured Discovery facets.Retrieve the Discovery Configuration for the provided name.getDiscoveryConfiguration(String name, boolean useDefault) Retrieve the configuration for the provided name.getDiscoveryConfiguration(Context context, IndexableObject indexableObject) Retrieve the discovery configuration for the provided IndexableObject.getDiscoveryConfigurationByNameOrIndexableObject(Context context, String configurationName, IndexableObject indexableObject) Retrieve the Discovery configuration for the provided name or IndexableObject.getDiscoveryConfigurationWithPrefixName(String prefixConfigurationName) Retrieves a list of all DiscoveryConfiguration objects where key starts with prefixConfigurationNamegetDiscoveryDSOConfiguration(Context context, DSpaceObject dso) Retrieve the discovery configuration for the provided DSO.Retrieves a list of all DiscoveryConfiguration objects whereDiscoveryConfiguration.isIndexAlways()is true These configurations should always be included when indexinggetMap()static voidvoidvoidsetToIgnoreMetadataFields(Map<Integer, List<String>> toIgnoreMetadataFields)
-
Constructor Details
-
DiscoveryConfigurationService
public DiscoveryConfigurationService()
-
-
Method Details
-
getMap
-
setMap
-
getToIgnoreMetadataFields
-
setToIgnoreMetadataFields
-
getDiscoveryConfiguration
public DiscoveryConfiguration getDiscoveryConfiguration(Context context, IndexableObject indexableObject) Retrieve the discovery configuration for the provided IndexableObject. When a DSpace Object can be retrieved from the IndexableObject, the discovery configuration will be returned for the DSpace Object. Otherwise, a check will be done to look for the unique index ID of the IndexableObject. When the IndexableObject is null, the default configuration will be retrieved When no direct match is found, the parent object will be checked until there is no parent left, in which case the "default" configuration will be returned.- Parameters:
context- - The database contextindexableObject- - The IndexableObject to retrieve the configuration for- Returns:
- the discovery configuration for the provided IndexableObject.
-
getDiscoveryDSOConfiguration
Retrieve the discovery configuration for the provided DSO. When no direct match is found, the parent object will be checked until there is no parent left, in which case the "default" configuration will be returned.- Parameters:
context- - The database contextdso- - The DSpace object to retrieve the configuration for- Returns:
- the discovery configuration for the provided DSO.
-
getDiscoveryConfiguration
Retrieve the Discovery Configuration for the provided name. When no configuration can be found for the name, the default configuration will be returned.- Parameters:
name- - The name of the configuration to be retrieved- Returns:
- the Discovery Configuration for the provided name, or default when none was found.
-
getDiscoveryConfiguration
Retrieve the configuration for the provided name. When useDefault is set to true, the "default" configuration will be returned when no match is found. When useDefault is set to false, null will be returned when no match is found.- Parameters:
name- - The name of the configuration to retrieveuseDefault- - Whether the default configuration should be used when no match is found- Returns:
- the configuration for the provided name
-
getDiscoveryConfigurationByNameOrIndexableObject
public DiscoveryConfiguration getDiscoveryConfigurationByNameOrIndexableObject(Context context, String configurationName, IndexableObject indexableObject) Retrieve the Discovery configuration for the provided name or IndexableObject. The configuration will first be checked for the provided name. When no match is found for the name, the configuration will be retrieved for the IndexableObject- Parameters:
context- - The database contextconfigurationName- - The name of the configuration to be retrievedindexableObject- - The indexable object to retrieve the configuration for- Returns:
- the Discovery configuration for the provided name, or when not found for the provided IndexableObject
-
getIndexAlwaysConfigurations
Retrieves a list of all DiscoveryConfiguration objects whereDiscoveryConfiguration.isIndexAlways()is true These configurations should always be included when indexing -
getAllUniqueFacetsConfig
Get the unique set of configured Discovery facets. This is used when inspecting configuration to include hierarchical vocabularies in the browse menu.- Returns:
- All unique instances of
DiscoverySearchFilterFacetincluded in "sidebarFacets" bean, across all Discovery configurations.
-
main
-
getDiscoveryConfigurationWithPrefixName
public List<DiscoveryConfiguration> getDiscoveryConfigurationWithPrefixName(String prefixConfigurationName) Retrieves a list of all DiscoveryConfiguration objects where key starts with prefixConfigurationName- Parameters:
prefixConfigurationName- string as prefix key
-