Class CollectionArchiveBean

java.lang.Object
io.goobi.viewer.managedbeans.CollectionArchiveBean
All Implemented Interfaces:
Serializable

@Named @ApplicationScoped public class CollectionArchiveBean extends Object implements Serializable
View helper exposing per-collection BagIt archive availability and download URLs to the collection page. The collection page only renders the download link when UserBean.isLoggedIn() is true; the download endpoint itself is additionally gated server-side.
See Also:
  • Constructor Details

    • CollectionArchiveBean

      public CollectionArchiveBean()
  • Method Details

    • isEnabled

      public boolean isEnabled()
      Returns:
      true if per-collection archive generation is enabled in the configuration
    • isAvailable

      public boolean isAvailable(BrowseDcElement element)
      Parameters:
      element - the collection element
      Returns:
      true if a downloadable archive currently exists on disk for the given collection
    • getDownloadUrl

      public String getDownloadUrl(BrowseDcElement element)
      Builds the download URL for a collection's archive. The URL is deterministic from field and collection name; whether a file actually exists is decided by isAvailable(BrowseDcElement) (used to gate rendering) and by the download endpoint itself.
      Parameters:
      element - the collection element
      Returns:
      the absolute REST download URL, or an empty string if the API base is unavailable