Package io.goobi.viewer.managedbeans
Class AdminLicenseBean
java.lang.Object
io.goobi.viewer.managedbeans.AdminLicenseBean
- All Implemented Interfaces:
Serializable
Administration backend functions.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionactivateTicketAction(AccessTicket ticket) deleteLicenseAction(License license) deleteLicenseAction.deleteLicenseTypeAction(LicenseType licenseType) deleteLicenseTypeAction.deleteTicketAction(AccessTicket ticket) extendTicketAction(AccessTicket ticket) getAllCoreLicenseTypes.Returns all existing license types.getAllRecordLicenseTypes.getCMSPagesUsingLicenseType(LicenseType licenseType) longgetConcurrentViewsLimitRecordCountForLicenseType(String licenseTypeName) Getter for the fieldcurrentLicense.Returns the user ID ofcurrentLicense.Getter for the fieldcurrentLicenseType.Returns the user ID ofcurrentLicenseType.Getter for the fieldcurrentRole.Getter for the fieldlazyModelTickets.getLicenses(LicenseType licenseType) getMessageKeyForPrivilege(String privilege) longgetNumRecordsWithAccessCondition(String accessCondition) Record count for non-configured access conditions.Returns all existing non-core license types minuscurrentLicenseType.getPageTickets.longgetPdfQuotaRecordCountForLicenseType(String licenseTypeName) Queries Solr for a list of all values of the set ACCESSCONDITION.longgetRecordCountForLicenseType(LicenseType licenseType) Record count for configured access conditions.getUrlQueryForAccessCondition(String accessCondition) voidinit()init.booleanisLicenseTypeInUse(LicenseType licenseType) voidCreatescurrentLicenseto a new instance.voidnewCurrentLicenseTypeAction.rejectTicketAction(AccessTicket ticket) renewTicketAction(AccessTicket ticket) voidresetCurrentRoleLicenseAction.Adds the current License to the licensee (User, UserGroup or IpRange).saveLicenseTypeAction.voidsetCurrentLicense(License currentLicense) Setter for the fieldcurrentLicense.voidSetscurrentLicenseby loading it from the DB via the given ID.voidsetCurrentLicenseType(LicenseType currentLicenseType) Setter for the fieldcurrentLicenseType.voidSetscurrentUserGroupby loading it from the DB via the given ID.voidsetCurrentRole(Role currentRole) Setter for the fieldcurrentRole.voidsetSelectedLanguage(Locale selectedLanguage)
-
Constructor Details
-
AdminLicenseBean
public AdminLicenseBean()Creates a new AdminBean instance.
-
-
Method Details
-
init
init. -
getAllLicenseTypes
Returns all existing license types. Required for admin tabs.- Returns:
- all license types in the database
- Throws:
DAOException- if any.
-
getGroupedLicenseTypeSelectItems
- Returns:
- Two SelectItemGroups for core and regular license types
- Throws:
DAOException
-
getAllCoreLicenseTypes
getAllCoreLicenseTypes.- Returns:
- all license types in the database where core=true
- Throws:
DAOException- if any.
-
getAllRecordLicenseTypes
getAllRecordLicenseTypes.- Returns:
- all license types in the database where core=false
- Throws:
DAOException- if any.
-
getOtherLicenseTypes
Returns all existing non-core license types minuscurrentLicenseType. Used for overriding license type selection.- Returns:
- a list of all non-core license types excluding the currently selected one
- Throws:
DAOException- if any.
-
saveCurrentLicenseTypeAction
saveLicenseTypeAction.- Returns:
- the navigation outcome after saving the current license type to the database
- Throws:
DAOException- if any.
-
deleteLicenseTypeAction
deleteLicenseTypeAction.- Parameters:
licenseType- aLicenseTypeobject.- Returns:
- Navigation outcome
- Throws:
DAOException- if any.
-
newCurrentLicenseTypeAction
newCurrentLicenseTypeAction.- Parameters:
name- name to assign to the new license type
-
resetCurrentRoleLicenseAction
public void resetCurrentRoleLicenseAction()resetCurrentRoleLicenseAction. -
getAllLicenses
- Throws:
DAOException
-
isLicenseTypeInUse
- Parameters:
licenseType- the license type to check for usage- Returns:
- true if at least one license uses the given license type; false otherwise
- Throws:
DAOException
-
getConcurrentViewsLimitRecordCountForLicenseType
public long getConcurrentViewsLimitRecordCountForLicenseType(String licenseTypeName) throws IndexUnreachableException, PresentationException - Parameters:
licenseTypeName- name of the license type to query records for- Returns:
- Number of records with the given licenseTypeName that have the ACCESSCONDITION_CONCURRENTUSE field
- Throws:
IndexUnreachableExceptionPresentationException
-
getPdfQuotaRecordCountForLicenseType
public long getPdfQuotaRecordCountForLicenseType(String licenseTypeName) throws IndexUnreachableException, PresentationException - Parameters:
licenseTypeName- name of the license type to query records for- Returns:
- Number of records with the given licenseTypeName that have the ACCESSCONDITION_PDF_PERCENTAGE_QUOTA field
- Throws:
IndexUnreachableExceptionPresentationException
-
getLicenses
- Parameters:
licenseType- the license type to retrieve licenses for- Returns:
- Number of licenses with of given
LicenseType - Throws:
DAOException
-
newCurrentLicenseAction
public void newCurrentLicenseAction()CreatescurrentLicenseto a new instance. -
saveCurrentLicenseAction
Adds the current License to the licensee (User, UserGroup or IpRange). It is imperative that the licensee object is refreshed after updating so that a new license object is an ID attached. Otherwise the list of licenses will throw an NPE!- Returns:
- Navigation outcome
- Throws:
DAOException- if any.DAOExceptionPresentationException
-
deleteLicenseAction
deleteLicenseAction.- Parameters:
license- aLicenseobject.- Returns:
- the navigation outcome after deleting the given license from the database
- Throws:
DAOException- if any.
-
getLazyModelTickets
Getter for the fieldlazyModelTickets.- Returns:
- the
TableDataProviderused for paginated access ticket listing in the admin interface
-
getPageTickets
getPageTickets.- Returns:
- a list of access tickets for the current page in the paginated ticket list
-
getTicketRequests
- Returns:
- List of existing tickets that are in request status
- Throws:
DAOException
-
activateTicketAction
- Parameters:
ticket- the access ticket to activate- Returns:
- Navigation outcome
- Throws:
DAOException
-
extendTicketAction
- Parameters:
ticket- the access ticket to extend- Returns:
- Navigation outcome
- Throws:
DAOException
-
renewTicketAction
- Parameters:
ticket- the access ticket to renew with a new password- Returns:
- Navigation outcome
- Throws:
DAOException
-
rejectTicketAction
- Parameters:
ticket- the access ticket request to reject and delete- Returns:
- Navigation outcome
- Throws:
DAOException
-
deleteTicketAction
- Parameters:
ticket- the access ticket to delete- Returns:
- Navigation outcome
- Throws:
DAOException
-
getCurrentRole
Getter for the fieldcurrentRole.- Returns:
- the
Rolecurrently being edited in the license admin interface, or null if none selected
-
setCurrentRole
Setter for the fieldcurrentRole.- Parameters:
currentRole- the role currently being edited in the license admin interface
-
getCurrentLicenseType
Getter for the fieldcurrentLicenseType.- Returns:
- the
LicenseTypecurrently being edited in the admin interface, or null if none selected
-
setCurrentLicenseType
Setter for the fieldcurrentLicenseType.- Parameters:
currentLicenseType- the license type currently being edited in the admin interface
-
getCurrentLicenseTypeId
Returns the user ID ofcurrentLicenseType.- Returns:
currentLicenseType.idif loaded and has ID; null if not
-
setCurrentLicenseTypeId
SetscurrentUserGroupby loading it from the DB via the given ID.- Parameters:
id- database ID of the license type to load- Throws:
DAOException
-
getCurrentLicense
Getter for the fieldcurrentLicense.- Returns:
- the
Licensecurrently being edited in the admin interface, or null if none selected
-
setCurrentLicense
Setter for the fieldcurrentLicense.- Parameters:
currentLicense- the license currently being edited in the admin interface
-
getCurrentLicenseId
Returns the user ID ofcurrentLicense.- Returns:
currentLicense.idif loaded and has ID; null if not
-
setCurrentLicenseId
SetscurrentLicenseby loading it from the DB via the given ID.- Parameters:
id- database ID of the license to load- Throws:
DAOException
-
getSelectedLanguage
-
setSelectedLanguage
-
getPossibleAccessConditions
public List<String> getPossibleAccessConditions() throws DAOException, IndexUnreachableException, PresentationExceptionQueries Solr for a list of all values of the set ACCESSCONDITION.- Returns:
- Combined List of access condition values from the index and CMS pages
- Throws:
DAOExceptionIndexUnreachableException- if any.PresentationException- if any.
-
getNotConfiguredAccessConditions
- Returns:
- List of access condition values that have no corresponding license type in the database
- Throws:
IndexUnreachableExceptionPresentationExceptionDAOException
-
getNumRecordsWithAccessCondition
public long getNumRecordsWithAccessCondition(String accessCondition) throws DAOException, IndexUnreachableException, PresentationException Record count for non-configured access conditions.- Parameters:
accessCondition- access condition value to count records for- Returns:
- Number of records containing the given access condition value
- Throws:
DAOExceptionPresentationExceptionIndexUnreachableException
-
getRecordCountForLicenseType
public long getRecordCountForLicenseType(LicenseType licenseType) throws DAOException, IndexUnreachableException, PresentationException Record count for configured access conditions.- Parameters:
licenseType- the license type whose record count to retrieve- Returns:
- Number of records containing the given access condition value
- Throws:
DAOExceptionIndexUnreachableExceptionPresentationException
-
getUrlQueryForAccessCondition
- Parameters:
accessCondition- access condition value to generate a query for- Returns:
- Generated query for given accessCondition
-
getCMSPagesUsingLicenseType
- Parameters:
licenseType- the license type whose access condition to search for in CMS pages- Returns:
- List of CMSPages that have the access condition of the given LicenseType assigned
- Throws:
DAOException
-
getMessageKeyForPrivilege
- Parameters:
privilege- privilege name to build a message key for- Returns:
- Composite message key for the given privilege name
-
getAccessTypeValues
-