Class AdminBean
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds currentUserRole to the map of UserRoles to be processed, marked as to save.Reset selected message entry and returns to the translations overview page.int
deleteFromCache
(List<String> identifiers, boolean fromContentCache, boolean fromThumbnailCache) deleteFromCache.int
deleteFromCache
(List<String> identifiers, boolean fromContentCache, boolean fromThumbnailCache, boolean fromPdfCache) deleteFromCache.void
deleteIpRangeAction
(IpRange ipRange) deleteIpRangeAction.void
deleteRoleAction
(Role role) deleteRoleAction.deleteUserAction
(User user, boolean deleteContributions) Deletes the given User and optionally their contributions.void
deleteUserGroupAction
(UserGroup userGroup) deleteUserGroupAction.void
deleteUserRoleAction
(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.long
getConfiguredTranslationGroupsCount.Getter for the fieldcurrentIpRange
.Returns the user ID ofcurrentIpRange/code>.
Getter for the fieldcurrentPassword
.Getter for the fieldcurrentRole
.Getter for the fieldcurrentTranslationGroup
.int
getCurrentTranslationGroupId.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
.int
Getter for the fieldhotfolderFileCount
.Getter for the fieldlazyModelUsers
.getPageUsers.Getter for the fieldpasswordOne
.Getter for the fieldpasswordTwo
.getTranslationGroupForFieldAndKey
(String field, String key) getTranslationGroupForFieldAndKey.static String
Getter for the fieldtranslationGroupsEditorSession
.getTranslationGroupsForSolrField.static List<TranslationGroup>
getTranslationGroupsForSolrFieldStatic.javax.servlet.http.Part
Getter for the fielduploadedAvatarFile
.void
init()
init.boolean
isDeleteUserContributions.boolean
isDisplayTranslationsDashboardWidget.boolean
isHasAccessPermissingForTranslationFiles.boolean
isNewMessageEntryModeAllowed.boolean
isTranslationLocked.void
lockTranslation.void
resetCurrentIpRangeAction.void
resetCurrentRoleAction.void
resetCurrentUserAction.void
resetCurrentUserGroupAction.void
resetCurrentUserRoleAction.void
resetDirtyUserRolesAction.resetUserAction
(User user, String returnPage) resetUserAction.void
SavescurrentTranslationGroup
if it has a selected entry.saveCurrentUserAction.saveIpRangeAction.void
saveRoleAction.Saves currently selected message entry in the current translation group and returns to the translations overview page.boolean
saveUserAction
(User user) Saves the given use.saveUserAction
(User user, String returnPage) saveUserAction.Persists changes incurrentUserGroup
.void
setCurrentIpRange
(IpRange currentIpRange) Setter for the fieldcurrentIpRange
.void
SetscurrentIpRange/code> by loading it from the DB via the given ID.
void
setCurrentPassword
(String currentPassword) Setter for the fieldcurrentPassword
.void
setCurrentRole
(Role currentRole) Setter for the fieldcurrentRole
.void
setCurrentTranslationGroup
(TranslationGroup currentTranslationGroup) Setter for the fieldcurrentTranslationGroup
.void
setCurrentTranslationGroupId
(int id) setCurrentTranslationGroupId.void
IfcurrentTranslationGroup
is set, looks up the message entry for the given key and pre-selects it.void
setCurrentUser
(User currentUser) Setter for the fieldcurrentUser
.void
setCurrentUserGroup
(UserGroup userGroup) Setter for the fieldcurrentUserGroup
.void
SetscurrentUserGroup/code> by loading it from the DB via the given ID.
void
setCurrentUserId
(Long id) Sets the current user by loading them from the DB via the given user ID.void
setCurrentUserRole
(UserRole currentUserRole) Setter for the fieldcurrentUserRole
.void
setDeleteUserContributions
(boolean deleteUserContributions) Setter for the fielddeleteUserContributions
.void
setEmailConfirmation
(String emailConfirmation) Setter for the fieldemailConfirmation
.void
setPasswordOne
(String passwordOne) Setter for the fieldpasswordOne
.void
setPasswordTwo
(String passwordTwo) Setter for the fieldpasswordTwo
.setRepresantativeImageAction
(String pi, String dataRepository, String fileIdRoot) setRepresantativeImageAction.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.static void
setTranslationGroupsEditorSession
(String translationGroupsEditorSession) Setter for the fieldtranslationGroupsEditorSession
.void
setUploadedAvatarFile
(javax.servlet.http.Part uploadedAvatarFile) Setter for the fielduploadedAvatarFile
.toggleSuspendUserAction
(User user) toggleSuspendUserAction.void
triggerMessage
(String message) triggerMessage.void
Triggers a mode for adding new message keys to the first LOCAL_STRINGS type group found.void
updateHotfolderFileCount.void
saveUserRoleAction.
-
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
List
object. - Throws:
DAOException
- if any.
-
getAllUsersExcept
getAllUsersExcept.
- Parameters:
usersToExclude
- aSet
object.- Returns:
- a
List
object. - Throws:
DAOException
- if any.
-
saveCurrentUserAction
saveCurrentUserAction.
- Returns:
- a
String
object - Throws:
DAOException
- if any.
-
saveUserAction
saveUserAction.
- Parameters:
user
- aUser
objectreturnPage
- aString
object- Returns:
- a
String
object - Throws:
DAOException
- if any.
-
resetUserAction
resetUserAction.
-
saveUserAction
Saves the given use. Attention: Used by regular users editing their own profile as well.
- Parameters:
user
- User to save- Returns:
- a
String
object. - 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
List
object. - Throws:
DAOException
- if any.
-
saveUserGroupAction
Persists changes incurrentUserGroup
.- Returns:
- Navigation outcome
- Throws:
DAOException
- if any.
-
deleteUserGroupAction
deleteUserGroupAction.
- Parameters:
userGroup
- aUserGroup
object.- Throws:
DAOException
- if any.
-
resetCurrentUserGroupAction
public void resetCurrentUserGroupAction()resetCurrentUserGroupAction.
-
getAllRoles
Returns a list of all existing roles. Required for admin tab components.- Returns:
- a
List
object. - Throws:
DAOException
- if any.
-
saveRoleAction
saveRoleAction.
- Throws:
DAOException
- if any.
-
deleteRoleAction
deleteRoleAction.
- Parameters:
role
- aRole
object.- 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
- aUserRole
object.- 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
- aIpRange
object.- Throws:
DAOException
- if any.
-
resetCurrentIpRangeAction
public void resetCurrentIpRangeAction()resetCurrentIpRangeAction.
-
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.id
if 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
- aLong
object- Throws:
DAOException
-
getCurrentUserGroup
Getter for the field
currentUserGroup
.- Returns:
- a
UserGroup
object.
-
setCurrentUserGroup
Setter for the field
currentUserGroup
.- Parameters:
userGroup
- aUserGroup
object.
-
getCurrentUserGroupId
Returns the user ID ofcurrentUserGroup/code>.
- Returns:
currentUserGroup.id
if loaded and has ID; null if not
-
setCurrentUserGroupId
SetscurrentUserGroup/code> by loading it from the DB via the given ID.
- Parameters:
id
- aLong
object- 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.id
if loaded and has ID; null if not
-
setCurrentIpRangeId
SetscurrentIpRange/code> by loading it from the DB via the given ID.
- Parameters:
id
- aLong
object- Throws:
DAOException
-
getLazyModelUsers
Getter for the field
lazyModelUsers
.- Returns:
- the lazyModelUsers
-
getPageUsers
getPageUsers.
- Returns:
- a
List
object.
-
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
- aList
object.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
- aList
object.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
- aUser
object.- Returns:
- a
String
object. - Throws:
DAOException
- if any.
-
triggerMessage
triggerMessage.
- Parameters:
message
- aString
object
-
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
TranslationGroup
s
-
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
TranslationGroup
that 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()SavescurrentTranslationGroup
if it has a selected entry. Resets group to null afterwards. -
getCurrentTranslationGroup
Getter for the field
currentTranslationGroup
.- Returns:
- the currentTranslationGroup
-
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 loadscurrentTranslationGroup
that matches the given id
-
getCurrentTranslationMessageKey
getCurrentTranslationMessageKey.
- Returns:
- Key of the currently selected entry; otherwise "-"
-
setCurrentTranslationMessageKey
IfcurrentTranslationGroup
is 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(javax.servlet.http.Part uploadedAvatarFile) Setter for the field
uploadedAvatarFile
.- Parameters:
uploadedAvatarFile
- the uploadedAvatarFile to set
-
getUploadedAvatarFile
public javax.servlet.http.Part getUploadedAvatarFile()Getter for the field
uploadedAvatarFile
.- Returns:
- the uploadedAvatarFile
-