Class DiscoveryConfigurationService
- java.lang.Object
-
- org.dspace.discovery.configuration.DiscoveryConfigurationService
-
public class DiscoveryConfigurationService extends Object
- Author:
- Kevin Van de Velde (kevin at atmire dot com)
-
-
Constructor Summary
Constructors Constructor Description DiscoveryConfigurationService()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<DiscoverySearchFilterFacet>getAllFacetsConfig()DiscoveryConfigurationgetDiscoveryConfiguration(String name)Retrieve the Discovery Configuration for the provided name.DiscoveryConfigurationgetDiscoveryConfiguration(String name, boolean useDefault)Retrieve the configuration for the provided name.DiscoveryConfigurationgetDiscoveryConfiguration(Context context, IndexableObject indexableObject)Retrieve the discovery configuration for the provided IndexableObject.DiscoveryConfigurationgetDiscoveryConfigurationByNameOrIndexableObject(Context context, String configurationName, IndexableObject indexableObject)Retrieve the Discovery configuration for the provided name or IndexableObject.List<DiscoveryConfiguration>getDiscoveryConfigurationWithPrefixName(String prefixConfigurationName)Retrieves a list of all DiscoveryConfiguration objects where key starts with prefixConfigurationNameDiscoveryConfigurationgetDiscoveryDSOConfiguration(Context context, DSpaceObject dso)Retrieve the discovery configuration for the provided DSO.List<DiscoveryConfiguration>getIndexAlwaysConfigurations()Retrieves a list of all DiscoveryConfiguration objects whereDiscoveryConfiguration.isIndexAlways()is true These configurations should always be included when indexingMap<String,DiscoveryConfiguration>getMap()Map<Integer,List<String>>getToIgnoreMetadataFields()static voidmain(String[] args)voidsetMap(Map<String,DiscoveryConfiguration> map)voidsetToIgnoreMetadataFields(Map<Integer,List<String>> toIgnoreMetadataFields)
-
-
-
Method Detail
-
getMap
public Map<String,DiscoveryConfiguration> getMap()
-
setMap
public void setMap(Map<String,DiscoveryConfiguration> map)
-
setToIgnoreMetadataFields
public void setToIgnoreMetadataFields(Map<Integer,List<String>> toIgnoreMetadataFields)
-
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
public DiscoveryConfiguration getDiscoveryDSOConfiguration(Context context, DSpaceObject dso)
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
public DiscoveryConfiguration getDiscoveryConfiguration(String name)
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
public DiscoveryConfiguration getDiscoveryConfiguration(String name, boolean useDefault)
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
public List<DiscoveryConfiguration> getIndexAlwaysConfigurations()
Retrieves a list of all DiscoveryConfiguration objects whereDiscoveryConfiguration.isIndexAlways()is true These configurations should always be included when indexing
-
getAllFacetsConfig
public List<DiscoverySearchFilterFacet> getAllFacetsConfig()
- Returns:
- All configurations for
DiscoverySearchFilterFacet
-
main
public static void main(String[] args)
-
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
-
-