Class AdminBean
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds currentUserRole to the map of UserRoles to be processed, marked as to save.Reset selected message entry and returns to the translations overview page.intdeleteFromCache(List<String> identifiers, boolean fromContentCache, boolean fromThumbnailCache) deleteFromCache.intdeleteFromCache(List<String> identifiers, boolean fromContentCache, boolean fromThumbnailCache, boolean fromPdfCache) deleteFromCache.voiddeleteIpRangeAction(IpRange ipRange) deleteIpRangeAction.voiddeleteRoleAction(Role role) deleteRoleAction.deleteUserAction(User user, boolean deleteContributions) Deletes the given User and optionally their contributions.voiddeleteUserGroupAction(UserGroup userGroup) deleteUserGroupAction.voiddeleteUserRoleAction(UserRole userRole) Adds currentUserRole to the map of UserRoles to be processed, marked as to delete.getAllIpRanges.Returns a list of all existing roles.Returns all user groups in the DB.Returns all users in the DB.getAllUsersExcept(Set<User> usersToExclude) getAllUsersExcept.getConfiguredTranslationGroups.longgetConfiguredTranslationGroupsCount.Getter for the fieldcurrentIpRange.Returns the user ID ofcurrentIpRange/code>.Getter for the fieldcurrentPassword.Getter for the fieldcurrentRole.Getter for the fieldcurrentTranslationGroup.intgetCurrentTranslationGroupId.getCurrentTranslationMessageKey.Getter for the fieldcurrentUser.Getter for the fieldcurrentUserGroup.Returns the user ID ofcurrentUserGroup/code>.Returns the user ID ofcurrentUser/code>.Getter for the fieldcurrentUserRole.Getter for the fieldemailConfirmation.intGetter for the fieldhotfolderFileCount.Getter for the fieldlazyModelUsers.getPageUsers.Getter for the fieldpasswordOne.Getter for the fieldpasswordTwo.getTranslationGroupForFieldAndKey(String field, String key) getTranslationGroupForFieldAndKey.static StringGetter for the fieldtranslationGroupsEditorSession.getTranslationGroupsForSolrField.static List<TranslationGroup> getTranslationGroupsForSolrFieldStatic.jakarta.servlet.http.PartGetter for the fielduploadedAvatarFile.voidinit()init.booleanisDeleteUserContributions.booleanisDisplayTranslationsDashboardWidget.booleanisHasAccessPermissingForTranslationFiles.booleanisNewMessageEntryModeAllowed.booleanisTranslationLocked.voidlockTranslation.voidmaintenanceModeToggleChangedListener(jakarta.faces.event.AjaxBehaviorEvent event) Ajax event listener for saving the maintenance mode after the enabled/disabled status has been toggled.voidresetCurrentIpRangeAction.voidresetCurrentRoleAction.voidSafe reset method that prevents NPE in EL.voidresetCurrentUserAction.voidresetCurrentUserGroupAction.voidresetCurrentUserRoleAction.voidresetDirtyUserRolesAction.resetUserAction(User user, String returnPage) resetUserAction.voidSavescurrentTranslationGroupif it has a selected entry.Deprecated.Seems to be unusedsaveIpRangeAction.saveMaintenanceModeAction.voidsaveRoleAction.Saves currently selected message entry in the current translation group and returns to the translations overview page.booleanSaves the given use.saveUserAction(User user, boolean forceCheckCurrentPassword, String returnPage) saveUserAction.Persists changes incurrentUserGroup.voidsetCurrentIpRange(IpRange currentIpRange) Setter for the fieldcurrentIpRange.voidSetscurrentIpRange/code> by loading it from the DB via the given ID.voidsetCurrentPassword(String currentPassword) Setter for the fieldcurrentPassword.voidsetCurrentRole(Role currentRole) Setter for the fieldcurrentRole.voidsetCurrentTranslationGroup(TranslationGroup currentTranslationGroup) Setter for the fieldcurrentTranslationGroup.voidsetCurrentTranslationGroupId(int id) setCurrentTranslationGroupId.voidIfcurrentTranslationGroupis set, looks up the message entry for the given key and pre-selects it.voidsetCurrentUser(User currentUser) Setter for the fieldcurrentUser.voidsetCurrentUserGroup(UserGroup userGroup) Setter for the fieldcurrentUserGroup.voidSetscurrentUserGroup/code> by loading it from the DB via the given ID.voidsetCurrentUserId(Long id) Sets the current user by loading them from the DB via the given user ID.voidsetCurrentUserRole(UserRole currentUserRole) Setter for the fieldcurrentUserRole.voidsetDeleteUserContributions(boolean deleteUserContributions) Setter for the fielddeleteUserContributions.voidsetEmailConfirmation(String emailConfirmation) Setter for the fieldemailConfirmation.voidsetMaintenanceMode(MaintenanceMode maintenanceMode) voidsetPasswordOne(String passwordOne) Setter for the fieldpasswordOne.voidsetPasswordTwo(String passwordTwo) Setter for the fieldpasswordTwo.setRepresantativeImageAction(String pi, String dataRepository, String fileIdRoot) setRepresantativeImageAction.static voidsetRepresantativeImageStatic(String pi, String dataRepository, String fileIdRoot) Opens the METS file for the given identifier and sets the attribute USE='banner' to all file elements that match the given file ID root.static voidsetTranslationGroupsEditorSession(String translationGroupsEditorSession) Setter for the fieldtranslationGroupsEditorSession.voidsetUploadedAvatarFile(jakarta.servlet.http.Part uploadedAvatarFile) Setter for the fielduploadedAvatarFile.toggleSuspendUserAction(User user) toggleSuspendUserAction.voidtriggerMessage(String message) triggerMessage.voidTriggers a mode for adding new message keys to the first LOCAL_STRINGS type group found.voidupdateHotfolderFileCount.voidsaveUserRoleAction.
-
Constructor Details
-
AdminBean
public AdminBean()Constructor for AdminBean.
-
-
Method Details
-
init
@PostConstruct public void init()init.
-
getAllUsers
Returns all users in the DB. Needed for getting a list of users (e.g for adding user group members).- Returns:
- a
Listobject. - Throws:
DAOException- if any.
-
getAllUsersExcept
getAllUsersExcept.
- Parameters:
usersToExclude- aSetobject.- Returns:
- a
Listobject. - Throws:
DAOException- if any.
-
saveCurrentUserAction
Deprecated.Seems to be unusedsaveCurrentUserAction.
- Returns:
- a
Stringobject - Throws:
DAOException- if any.
-
saveUserAction
public String saveUserAction(User user, boolean forceCheckCurrentPassword, String returnPage) throws DAOException saveUserAction.
- Parameters:
user- aUserobjectforceCheckCurrentPassword- If true, even if an admin is changing their own passwordreturnPage- aStringobject- Returns:
- a
Stringobject - Throws:
DAOException- if any.
-
resetUserAction
resetUserAction.
-
saveUser
Saves the given use. Attention: Used by regular users editing their own profile as well.
- Parameters:
user- User to saveforceCheckCurrentPassword- If true, even if an admin is changing their own password- Returns:
- a
Stringobject. - Throws:
DAOException- if any.
-
deleteUserAction
Deletes the given User and optionally their contributions. This method is user for admin-induced deletion of other users as well as self-deletion by a user.
- Parameters:
user- User to be deleteddeleteContributions- If true, all content created by this user will also be deleted- Returns:
- Navigation outcome
- Throws:
DAOException- if any.
-
resetCurrentUserAction
public void resetCurrentUserAction()resetCurrentUserAction.
-
getAllUserGroups
Returns all user groups in the DB. Needed for getting a list of users (e.g for adding user group members).- Returns:
- a
Listobject. - Throws:
DAOException- if any.
-
saveUserGroupAction
Persists changes incurrentUserGroup.- Returns:
- Navigation outcome
- Throws:
DAOException- if any.
-
deleteUserGroupAction
deleteUserGroupAction.
- Parameters:
userGroup- aUserGroupobject.- Throws:
DAOException- if any.
-
resetCurrentUserGroupAction
public void resetCurrentUserGroupAction()resetCurrentUserGroupAction.
-
getAllRoles
Returns a list of all existing roles. Required for admin tab components.- Returns:
- a
Listobject. - Throws:
DAOException- if any.
-
saveRoleAction
saveRoleAction.
- Throws:
DAOException- if any.
-
deleteRoleAction
deleteRoleAction.
- Parameters:
role- aRoleobject.- Throws:
DAOException- if any.
-
resetCurrentRoleAction
public void resetCurrentRoleAction()resetCurrentRoleAction.
-
resetCurrentUserRoleAction
public void resetCurrentUserRoleAction()resetCurrentUserRoleAction.
-
resetDirtyUserRolesAction
public void resetDirtyUserRolesAction()resetDirtyUserRolesAction.
-
addUserRoleAction
Adds currentUserRole to the map of UserRoles to be processed, marked as to save.- Throws:
DAOException
-
deleteUserRoleAction
Adds currentUserRole to the map of UserRoles to be processed, marked as to delete.
- Parameters:
userRole- aUserRoleobject.- Throws:
DAOException- if any.
-
updateUserRoles
saveUserRoleAction.
- Throws:
DAOException- if any.
-
getAllIpRanges
getAllIpRanges.
- Returns:
- all IpRanges from the database
- Throws:
DAOException
-
saveIpRangeAction
saveIpRangeAction.
- Returns:
- Navigation outcome
- Throws:
DAOException- if any.
-
deleteIpRangeAction
deleteIpRangeAction.
- Parameters:
ipRange- aIpRangeobject.- Throws:
DAOException- if any.
-
resetCurrentIpRangeAction
public void resetCurrentIpRangeAction()resetCurrentIpRangeAction.
-
saveMaintenanceModeAction
saveMaintenanceModeAction.
- Returns:
- Navigation outcome
- Throws:
DAOException- if any.
-
maintenanceModeToggleChangedListener
public void maintenanceModeToggleChangedListener(jakarta.faces.event.AjaxBehaviorEvent event) throws DAOException Ajax event listener for saving the maintenance mode after the enabled/disabled status has been toggled. Using a valueChangeListener instead (via viewerComponent:toggleSwitch) resulted in the listener firing before the setter.- Parameters:
event-AjaxBehaviorEvent- Throws:
DAOException
-
getCurrentUser
Getter for the field
currentUser.- Returns:
- the currentUser
-
setCurrentUser
Setter for the field
currentUser.- Parameters:
currentUser- the currentUser to set
-
getCurrentUserId
Returns the user ID ofcurrentUser/code>.- Returns:
currentUser.idif loaded and has ID; null if not
-
setCurrentUserId
Sets the current user by loading them from the DB via the given user ID.- Parameters:
id- aLongobject- Throws:
DAOException
-
getCurrentUserGroup
Getter for the field
currentUserGroup.- Returns:
- a
UserGroupobject.
-
setCurrentUserGroup
Setter for the field
currentUserGroup.- Parameters:
userGroup- aUserGroupobject.
-
getCurrentUserGroupId
Returns the user ID ofcurrentUserGroup/code>.- Returns:
currentUserGroup.idif loaded and has ID; null if not
-
setCurrentUserGroupId
SetscurrentUserGroup/code> by loading it from the DB via the given ID.- Parameters:
id- aLongobject- Throws:
DAOException
-
getCurrentRole
Getter for the field
currentRole.- Returns:
- the currentRole
-
setCurrentRole
Setter for the field
currentRole.- Parameters:
currentRole- the currentRole to set
-
getCurrentUserRole
Getter for the field
currentUserRole.- Returns:
- the currentUserRole
-
setCurrentUserRole
Setter for the field
currentUserRole.- Parameters:
currentUserRole- the currentUserRole to set
-
getCurrentIpRange
Getter for the field
currentIpRange.- Returns:
- the currentIpRange
-
setCurrentIpRange
Setter for the field
currentIpRange.- Parameters:
currentIpRange- the currentIpRange to set
-
getCurrentIpRangeId
Returns the user ID ofcurrentIpRange/code>.- Returns:
currentIpRange.idif loaded and has ID; null if not
-
setCurrentIpRangeId
SetscurrentIpRange/code> by loading it from the DB via the given ID.- Parameters:
id- aLongobject- Throws:
DAOException
-
getLazyModelUsers
Getter for the field
lazyModelUsers.- Returns:
- the lazyModelUsers
-
getPageUsers
getPageUsers.
- Returns:
- a
Listobject.
-
getCurrentPassword
Getter for the field
currentPassword.- Returns:
- the currentPassword
-
setCurrentPassword
Setter for the field
currentPassword.- Parameters:
currentPassword- the currentPassword to set
-
getPasswordOne
Getter for the field
passwordOne.- Returns:
- the passwordOne
-
setPasswordOne
Setter for the field
passwordOne.- Parameters:
passwordOne- the passwordOne to set
-
getPasswordTwo
Getter for the field
passwordTwo.- Returns:
- the passwordTwo
-
setPasswordTwo
Setter for the field
passwordTwo.- Parameters:
passwordTwo- the passwordTwo to set
-
getEmailConfirmation
Getter for the field
emailConfirmation.- Returns:
- the emailConfirmation
-
setEmailConfirmation
Setter for the field
emailConfirmation.- Parameters:
emailConfirmation- the emailConfirmation to set
-
isDeleteUserContributions
public boolean isDeleteUserContributions()isDeleteUserContributions.
- Returns:
- the deleteUserContributions
-
setDeleteUserContributions
public void setDeleteUserContributions(boolean deleteUserContributions) Setter for the field
deleteUserContributions.- Parameters:
deleteUserContributions- the deleteUserContributions to set
-
deleteFromCache
public int deleteFromCache(List<String> identifiers, boolean fromContentCache, boolean fromThumbnailCache) deleteFromCache.
- Parameters:
identifiers- aListobject.fromContentCache- a boolean.fromThumbnailCache- a boolean.- Returns:
- a int.
-
deleteFromCache
public int deleteFromCache(List<String> identifiers, boolean fromContentCache, boolean fromThumbnailCache, boolean fromPdfCache) throws DAOException deleteFromCache.
- Parameters:
identifiers- aListobject.fromContentCache- a boolean.fromThumbnailCache- a boolean.fromPdfCache- a boolean.- Returns:
- a int.
- Throws:
DAOException
-
setRepresantativeImageAction
setRepresantativeImageAction.
-
setRepresantativeImageStatic
public static void setRepresantativeImageStatic(String pi, String dataRepository, String fileIdRoot) Opens the METS file for the given identifier and sets the attribute USE='banner' to all file elements that match the given file ID root. Any USE='banner' attributes that do not match the file ID root are removed. Solr schema version "intranda_viewer-20130117" or newer required. -
toggleSuspendUserAction
toggleSuspendUserAction.
- Parameters:
user- aUserobject.- Returns:
- a
Stringobject. - Throws:
DAOException- if any.
-
triggerMessage
triggerMessage.
- Parameters:
message- aStringobject
-
isDisplayTranslationsDashboardWidget
public boolean isDisplayTranslationsDashboardWidget()isDisplayTranslationsDashboardWidget.
- Returns:
- true if at least one group is not fully translated; false otherwise
-
getConfiguredTranslationGroupsCount
public long getConfiguredTranslationGroupsCount()getConfiguredTranslationGroupsCount.
- Returns:
- Number of configured translation grouns
-
getConfiguredTranslationGroups
getConfiguredTranslationGroups.
- Returns:
- All configured
TranslationGroups
-
getTranslationGroupsForSolrField
getTranslationGroupsForSolrField.
- Parameters:
field- Index field that the translation groups should have as a key- Returns:
- List of TranslationGroups; null if not found
-
getTranslationGroupForFieldAndKey
getTranslationGroupForFieldAndKey.
- Parameters:
field- Solr fieldkey- Message key- Returns:
- First
TranslationGroupthat contains the requested field+key; null if none found
-
getTranslationGroupsForSolrFieldStatic
getTranslationGroupsForSolrFieldStatic.
- Parameters:
field- Index field that the translation groups should have as a key- Returns:
- List of TranslationGroups; null if not found
-
saveAndResetCurrentTranslationGroup
public void saveAndResetCurrentTranslationGroup()SavescurrentTranslationGroupif it has a selected entry. Resets group to null afterwards. -
getCurrentTranslationGroup
Getter for the field
currentTranslationGroup.- Returns:
- the currentTranslationGroup
-
resetCurrentTranslationGroupStatusCount
public void resetCurrentTranslationGroupStatusCount()Safe reset method that prevents NPE in EL. -
setCurrentTranslationGroup
Setter for the field
currentTranslationGroup.- Parameters:
currentTranslationGroup- the currentTranslationGroup to set
-
isNewMessageEntryModeAllowed
public boolean isNewMessageEntryModeAllowed()isNewMessageEntryModeAllowed.
- Returns:
- true if at least one LOCAL_STRINGS type group is found in config; false otherwise
-
triggerNewMessageEntryMode
public void triggerNewMessageEntryMode()Triggers a mode for adding new message keys to the first LOCAL_STRINGS type group found. -
saveSelectedMessageEntryAction
Saves currently selected message entry in the current translation group and returns to the translations overview page.- Returns:
- Target page
-
cancelSelectedMessageEntryAction
Reset selected message entry and returns to the translations overview page.- Returns:
- Target page
-
getCurrentTranslationGroupId
public int getCurrentTranslationGroupId()getCurrentTranslationGroupId.
- Returns:
- Index of currentTranslationGroup in the list of configured groups
-
setCurrentTranslationGroupId
public void setCurrentTranslationGroupId(int id) setCurrentTranslationGroupId.
- Parameters:
id- Looks up and loadscurrentTranslationGroupthat matches the given id
-
getCurrentTranslationMessageKey
getCurrentTranslationMessageKey.
- Returns:
- Key of the currently selected entry; otherwise "-"
-
setCurrentTranslationMessageKey
IfcurrentTranslationGroupis set, looks up the message entry for the given key and pre-selects it.- Parameters:
key- Message key to select
-
isTranslationLocked
public boolean isTranslationLocked()isTranslationLocked.
- Returns:
- true if translations are locked by a different user; false otherwise
-
lockTranslation
public void lockTranslation()lockTranslation.
-
getTranslationGroupsEditorSession
Getter for the field
translationGroupsEditorSession.- Returns:
- the translationGroupsEditorSession
-
setTranslationGroupsEditorSession
Setter for the field
translationGroupsEditorSession.- Parameters:
translationGroupsEditorSession- the translationGroupsEditorSession to set
-
updateHotfolderFileCount
public void updateHotfolderFileCount()updateHotfolderFileCount.
-
getHotfolderFileCount
public int getHotfolderFileCount()Getter for the field
hotfolderFileCount.- Returns:
- Number of queued records in hotfolder
-
isHasAccessPermissingForTranslationFiles
public boolean isHasAccessPermissingForTranslationFiles()isHasAccessPermissingForTranslationFiles.
- Returns:
TranslationGroup.isHasFileAccess()
-
setUploadedAvatarFile
public void setUploadedAvatarFile(jakarta.servlet.http.Part uploadedAvatarFile) Setter for the field
uploadedAvatarFile.- Parameters:
uploadedAvatarFile- the uploadedAvatarFile to set
-
getUploadedAvatarFile
public jakarta.servlet.http.Part getUploadedAvatarFile()Getter for the field
uploadedAvatarFile.- Returns:
- the uploadedAvatarFile
-
getMaintenanceMode
- Returns:
- the maintenanceMode
-
setMaintenanceMode
- Parameters:
maintenanceMode- the maintenanceMode to set
-