Package io.goobi.viewer.managedbeans
Class ArchiveBean
java.lang.Object
io.goobi.viewer.managedbeans.ArchiveBean
- All Implemented Interfaces:
Serializable
JSF backing bean for the archive view. Manages loading, searching, and navigating EAD-based
archive trees, and maintains the selected archive resource and entry state per user session.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcollapseEntry(ArchiveEntry entry) collapseEntry.deleteArchiveAction.voidexpandEntry(ArchiveEntry entry) expandEntry.Returns a label for the archive page without requiring a materialized archive tree.getArchiveHierarchyForIdentifier(String identifier) Returns the entry hierarchy from the root down to the entry with the given identifier.getCardCatalogBootstrapJson(String contextPath, Map<String, String> translations) Serializes the card catalog configuration for an inline script.getMetsResolverUrl.getNodeType(String name) intvoidvoidinitializeArchiveTree(String selectedEntryId) Loads the archive tree of the current resource.booleanbooleanbooleanvoidloadDatabaseResource(String resourceId) voidIf only one archive database exists and database status isArchiveManager.DatabaseState.ARCHIVES_LOADED, redirect to the matching url.Exports the currently loaded archive for re-indexing.voidreset()selectEntryAction(ArchiveEntry entry) voidsetCurrentResource(String currentResource) voidsetSearchString(String searchString) voidSetter for the URL parameter.voidtoggleEntryExpansion(ArchiveEntry entry) void
-
Constructor Details
-
ArchiveBean
public ArchiveBean() -
ArchiveBean
-
-
Method Details
-
reset
public void reset() -
initializeArchiveTree
- Throws:
ArchiveException
-
initializeArchiveTree
Loads the archive tree of the current resource. For card catalogs no tree is built at all: that view loads its data through the card catalog REST API, and the full tree may hold hundreds of thousands of nodes.- Parameters:
selectedEntryId- ID of the archive entry to select after loading; may be null- Throws:
ArchiveException- if the archive database cannot be retrieved
-
getBreadcrumbTitle
- Returns:
- configured title or root entry label
-
getTrueRoot
- Returns:
- actual root element of the document, even if it's not in the displayed tree
-
getArchiveTree
-
getArchiveConfig
-
isCardCatalog
public boolean isCardCatalog()- Returns:
- true if the current archive resource is flagged as a card catalog in its CMS configuration
-
getCardCatalogBootstrapJson
Serializes the card catalog configuration for an inline script. Escaping the HTML-sensitive characters after JSON serialization prevents a value such as</script>from ending the script element before the browser parses the JSON value.- Parameters:
contextPath- servlet context pathtranslations- translated UI strings keyed by message key- Returns:
- a JavaScript-safe JSON object literal
-
toggleEntryExpansion
-
expandEntry
expandEntry.- Parameters:
entry- aTOCElementobject.
-
collapseEntry
collapseEntry.- Parameters:
entry- aTOCElementobject.
-
getArchiveHierarchyForIdentifier
Returns the entry hierarchy from the root down to the entry with the given identifier.- Parameters:
identifier- Entry identifier- Returns:
- List
-
selectEntryAction
- Parameters:
entry- archive entry to select- Returns:
- empty string
-
searchAction
- Returns:
- empty string
-
getSearchString
-
setSearchString
-
getSelectedEntryId
- Returns:
- ID of the selected entry
-
setSelectedEntryId
Setter for the URL parameter. Loads the entry that has the given ID. Loads the tree, if this is a new sessions.- Parameters:
id- Entry ID
-
isSearchActive
public boolean isSearchActive() -
getDisplayEntry
- Returns:
- the
ArchiveEntryto display in the metadata section of the archives view. EitherArchiveTree.getSelectedEntry()orArchiveTree.getRootElement()if the former is null
-
getArchiveDisplayLabel
Returns a label for the archive page without requiring a materialized archive tree. Card catalogs intentionally have no session archive tree, so their resource name is the fallback for the hero title and accessible image labels.- Returns:
- displayed entry label, archive resource name, or resource identifier
-
getDatabaseState
-
isDatabaseLoaded
public boolean isDatabaseLoaded() -
getCurrentResource
-
setCurrentResource
-
getCurrentArchive
-
getFilteredArchiveWrappers
- Throws:
DAOException
-
getFilteredDatabases
- Returns:
- Available databases, filtered by user access
-
getNumArchives
public int getNumArchives() -
getArchiveId
-
loadDatabaseResource
- Throws:
ArchiveException
-
redirectToOnlyDatabase
public void redirectToOnlyDatabase()If only one archive database exists and database status isArchiveManager.DatabaseState.ARCHIVES_LOADED, redirect to the matching url. -
getUpdatedNodeTypes
-
getNodeType
- Parameters:
name- Node type name- Returns:
- NoedType with the given name; null if none found
-
updateArchives
public void updateArchives() -
getEadResolverUrl
getMetsResolverUrl.- Returns:
- METS resolver link
-
reIndexArchiveAction
public String reIndexArchiveAction() throws IndexUnreachableException, DAOException, RecordNotFoundExceptionExports the currently loaded archive for re-indexing.- Returns:
- the empty navigation outcome string after triggering re-indexing
- Throws:
IndexUnreachableException- if any.DAOException- if any.RecordNotFoundException- if any.
-
deleteArchiveAction
deleteArchiveAction.- Returns:
- outcome
- Throws:
IOException- if any.IndexUnreachableException- if any.
-