Class DiscoveryConfigurationService


  • public class DiscoveryConfigurationService
    extends Object
    Author:
    Kevin Van de Velde (kevin at atmire dot com)
    • Constructor Detail

      • DiscoveryConfigurationService

        public DiscoveryConfigurationService()
    • Method Detail

      • 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 context
        indexableObject - - 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 context
        dso - - 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 retrieve
        useDefault - - 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 context
        configurationName - - The name of the configuration to be retrieved
        indexableObject - - The indexable object to retrieve the configuration for
        Returns:
        the Discovery configuration for the provided name, or when not found for the provided IndexableObject
      • 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