Package io.goobi.viewer.model.cms
Class CMSNavigationManager
java.lang.Object
io.goobi.viewer.model.cms.CMSNavigationManager
- All Implemented Interfaces:
Serializable
Manages loading, persisting, and reordering of CMS navigation menu items.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCMSNavigationManager(String associatedTheme) Creates a new CMSNavigationManager instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAvailableItem.voidaddCMSPageItems.voidAdd all items fromavailableItemstovisibleItemsfor whichSelectableNavigationItem.isSelected()is true.voidaddVisibleItem(CMSNavigationItem navigationItem) addVisibleItem.Getter for the fieldassociatedTheme.Getter for the fieldavailableItems.getItem.Getter for the fieldvisibleItems.final voidloadItems.loadItemsFromDatabase.final List<CMSNavigationItem> loadVisibleItems.voidreload()reload.voidsaveVisibleItems(String theme) Replaces the complete navigation-item database table with the elements of 'visibleItems'.voidsetVisibleItems(List<CMSNavigationItem> items) Adds the given item, along with all their descendants to the visible item list.
-
Constructor Details
-
CMSNavigationManager
Creates a new CMSNavigationManager instance.- Parameters:
associatedTheme- theme name whose navigation items are managed.
-
-
Method Details
-
loadItems
loadItems.- Throws:
DAOException- if any.
-
addCMSPageItems
addCMSPageItems.- Throws:
DAOException- if any.
-
getAvailableItems
Getter for the fieldavailableItems.- Returns:
- list of all items selectable for the navigation menu.
-
addSelectedItemsToMenu
public void addSelectedItemsToMenu()Add all items fromavailableItemstovisibleItemsfor whichSelectableNavigationItem.isSelected()is true. Afterwards setsSelectableNavigationItem.isSelected()to fals for allavailableItems -
loadVisibleItems
loadVisibleItems.- Returns:
- the sublist of available menu items matching the navigationMenuItem-list from the database (in label and url)
- Throws:
DAOException- if any.
-
loadItemsFromDatabase
loadItemsFromDatabase.- Returns:
- list of top-level navigation items for the associated theme.
- Throws:
DAOException- if any.
-
getVisibleItems
Getter for the fieldvisibleItems.- Returns:
- ordered list of navigation items currently in the menu.
-
setVisibleItems
Adds the given item, along with all their descendants to the visible item list.- Parameters:
items- navigation items (and their descendants) to set as visible.
-
saveVisibleItems
Replaces the complete navigation-item database table with the elements of 'visibleItems'.- Parameters:
theme- theme name whose navigation table is replaced.- Throws:
DAOException- if any.
-
reload
reload.- Throws:
DAOException- if any.
-
getItem
getItem.- Parameters:
id- the item'sCMSNavigationItem.getSortingListId()- Returns:
- The first matching item from all visible items as optional. Empty optional if no matching item was found
-
getAssociatedTheme
Getter for the fieldassociatedTheme.- Returns:
- the theme name whose navigation items are managed by this instance
-