Class CollectionArchiveConfig

java.lang.Object
io.goobi.viewer.model.export.bagit.CollectionArchiveConfig

public class CollectionArchiveConfig extends Object
The resolved set of content types that a per-collection BagIt archive should contain, as configured in config_viewer.xml under <collectionArchives>.

A <default field="…"> block defines the baseline for a Solr collection field; a <collection name="…" field="…"> block defines a sparse override — only the content-type toggles it lists change the effective set, everything else is inherited from the default. The merge of override onto default is performed while reading the configuration (see Configuration.getCollectionArchiveConfig(String, String)); this class simply holds the resolved, effective set of enabled content types.

Instances are immutable.

  • Constructor Details

    • CollectionArchiveConfig

      public CollectionArchiveConfig(String field, String collectionName, Set<ArchiveContentType> enabledTypes)
      Parameters:
      field - the Solr collection field this configuration applies to (e.g. DC)
      collectionName - the collection name for a per-collection override, or null for the <default> block
      enabledTypes - the content types explicitly enabled in this block (never null)
  • Method Details

    • getField

      public String getField()
      Returns:
      the Solr collection field (e.g. DC)
    • getCollectionName

      public String getCollectionName()
      Returns:
      the collection name for a per-collection override, or null for the default block
    • getEnabledTypes

      public Set<ArchiveContentType> getEnabledTypes()
      Returns:
      the effective set of enabled content types (unmodifiable, never null)
    • isEnabled

      public boolean isEnabled(ArchiveContentType type)
      Parameters:
      type - the content type to check
      Returns:
      true if the given content type is enabled in this configuration
    • hasEnabledTypes

      public boolean hasEnabledTypes()
      Returns:
      true if at least one content type is enabled, i.e. an archive would actually contain payload
    • toString

      public String toString()
      Overrides:
      toString in class Object