Package io.goobi.viewer.model.archives
Class ArchiveManager
java.lang.Object
io.goobi.viewer.model.archives.ArchiveManager
- All Implemented Interfaces:
Serializable
Loads and holds archive tree models. This class should have an application wide scope
- Author:
- florian
- See Also:
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfindIndexedNeighbours
(String entryId) In the list of archive document search hits, find the id of the entry just before the given onegetArchive
(String resourceId) getArchiveHierarchyForIdentifier
(ArchiveResource resource, String identifier) Returns the entry hierarchy from the root down to the entry with the given identifier.getArchiveResource
(String archiveName) getArchiveTree
(String resourceId) getArchiveUrl
(ArchiveResource resource, String entryIdentifier) getNodeType
(String name) Returns the node type configured for the given name.If only one archive database exists and database status isArchiveManager.DatabaseState.ARCHIVES_LOADED
, redirect to the matching url.Reloads nodeTyps from the config.boolean
loadArchiveForEntry
(String identifier) void
Checks the list of ead archives for updates.
-
Constructor Details
-
ArchiveManager
public ArchiveManager()
-
-
Method Details
-
getArchiveTree
public ArchiveTree getArchiveTree(String resourceId) throws IllegalStateException, PresentationException, IndexUnreachableException - Parameters:
resourceId
-- Returns:
ArchiveTree
- Throws:
IllegalStateException
PresentationException
IndexUnreachableException
-
getArchiveResource
- Parameters:
archiveName
-- Returns:
- ArchiveResource
-
getNodeType
Returns the node type configured for the given name. If no node type is configured for the name, then the default node type - indicated by thedefault="true"
attribute - is used- Parameters:
name
-- Returns:
NodeType
-
getOnlyDatabaseResource
If only one archive database exists and database status isArchiveManager.DatabaseState.ARCHIVES_LOADED
, redirect to the matching url.- Returns:
- Optional
-
loadArchiveForEntry
public ArchiveResource loadArchiveForEntry(String identifier) throws IllegalStateException, PresentationException, IndexUnreachableException - Parameters:
identifier
-- Returns:
- ArchiveResource
- Throws:
IllegalStateException
PresentationException
IndexUnreachableException
-
getArchiveUrl
- Parameters:
resource
-entryIdentifier
-- Returns:
- Constructed URL
-
getDatabaseState
-
getDatabases
- Returns:
- List
-
findIndexedNeighbours
public org.apache.commons.lang3.tuple.Pair<Optional<String>,Optional<String>> findIndexedNeighbours(String entryId) throws PresentationException, IndexUnreachableException In the list of archive document search hits, find the id of the entry just before the given one- Parameters:
entryId
-- Returns:
- the neighboring entry id if it exists
- Throws:
PresentationException
IndexUnreachableException
-
getArchiveHierarchyForIdentifier
public List<ArchiveEntry> getArchiveHierarchyForIdentifier(ArchiveResource resource, String identifier) Returns the entry hierarchy from the root down to the entry with the given identifier.- Parameters:
resource
-identifier
- Entry identifier- Returns:
- List of entries An empty list if the identified node has no ancestors or doesn't exist
-
getArchive
-
getUpdatedNodeTypes
Reloads nodeTyps from the config.- Returns:
- this.nodeTypes
-
updateArchiveList
public void updateArchiveList()Checks the list of ead archives for updates. An update occurs if either the "lastModifiedDate" of an archive has changed since the last request, or if an archive was added or removed. In these cases, the list of records associated with an archive entry is updated as well -
isInErrorState
public boolean isInErrorState() -
getEadParser
- Returns:
- the eadParser
-