Package io.goobi.viewer.managedbeans
Class CollectionArchiveBean
java.lang.Object
io.goobi.viewer.managedbeans.CollectionArchiveBean
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDownloadUrl(BrowseDcElement element) Builds the download URL for a collection's archive.booleanisAvailable(BrowseDcElement element) boolean
-
Constructor Details
-
CollectionArchiveBean
public CollectionArchiveBean()
-
-
Method Details
-
isEnabled
public boolean isEnabled()- Returns:
- true if per-collection archive generation is enabled in the configuration
-
isAvailable
- Parameters:
element- the collection element- Returns:
- true if a downloadable archive currently exists on disk for the given collection
-
getDownloadUrl
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 byisAvailable(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
-