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.List<jakarta.faces.model.SelectItem> 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 ACCESSCONDITIONlonggetRecordCountForLicenseType(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.
-
Constructor Details
-
AdminLicenseBean
public AdminLicenseBean()Constructor for AdminBean.
-
-
Method Details
-
init
@PostConstruct public void 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
Listobject. - Throws:
DAOException- if any.
-
saveCurrentLicenseTypeAction
saveLicenseTypeAction.
- Returns:
- a
Stringobject. - Throws:
DAOException- if any.
-
deleteLicenseTypeAction
deleteLicenseTypeAction.
- Parameters:
licenseType- aLicenseTypeobject.- Returns:
- Navigation outcome
- Throws:
DAOException- if any.
-
newCurrentLicenseTypeAction
newCurrentLicenseTypeAction.
- Parameters:
name-
-
resetCurrentRoleLicenseAction
public void resetCurrentRoleLicenseAction()resetCurrentRoleLicenseAction.
-
getAllLicenses
- Throws:
DAOException
-
isLicenseTypeInUse
- Parameters:
licenseType-- 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-- 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-- Returns:
- Number of records with the given licenseTypeName that have the ACCESSCONDITION_PDF_PERCENTAGE_QUOTA field
- Throws:
IndexUnreachableExceptionPresentationException
-
getLicenses
- Parameters:
licenseType-- Returns:
- Number of licenses with of given
LicenseType - Throws:
DAOException
-
newCurrentLicenseAction
public void newCurrentLicenseAction()Creates
currentLicenseto 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:
- a
Stringobject. - Throws:
DAOException- if any.
-
getLazyModelTickets
Getter for the field
lazyModelTickets.- Returns:
- the lazyModelTickets
-
getPageTickets
getPageTickets.
- Returns:
- a
Listobject.
-
getTicketRequests
- Returns:
- List of existing tickets that are in request status
- Throws:
DAOException
-
activateTicketAction
- Parameters:
ticket-- Returns:
- Navigation outcome
- Throws:
DAOException
-
extendTicketAction
- Parameters:
ticket-- Returns:
- Navigation outcome
- Throws:
DAOException
-
renewTicketAction
- Parameters:
ticket-- Returns:
- Navigation outcome
- Throws:
DAOException
-
rejectTicketAction
- Parameters:
ticket-- Returns:
- Navigation outcome
- Throws:
DAOException
-
deleteTicketAction
- Parameters:
ticket-- Returns:
- Navigation outcome
- Throws:
DAOException
-
getCurrentRole
Getter for the field
currentRole.- Returns:
- the currentRole
-
setCurrentRole
Setter for the field
currentRole.- Parameters:
currentRole- the currentRole to set
-
getCurrentLicenseType
Getter for the field
currentLicenseType.- Returns:
- the currentLicenseType
-
setCurrentLicenseType
Setter for the field
currentLicenseType.- Parameters:
currentLicenseType- the currentLicenseType to set
-
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-- Throws:
DAOException
-
getCurrentLicense
Getter for the field
currentLicense.- Returns:
- the currentLicense
-
setCurrentLicense
Setter for the field
currentLicense.- Parameters:
currentLicense- the currentLicense to set
-
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-- Throws:
DAOException
-
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-- 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-- Returns:
- Number of records containing the given access condition value
- Throws:
DAOExceptionIndexUnreachableExceptionPresentationException
-
getUrlQueryForAccessCondition
- Parameters:
accessCondition-- Returns:
- Generated query for given accessCondition
-
getCMSPagesUsingLicenseType
- Parameters:
licenseType-- Returns:
- List of CMSPages that have the access condition of the given LicenseType assigned
- Throws:
DAOException
-
getMessageKeyForPrivilege
- Parameters:
privilege-- Returns:
- Composite message key for the given privilege name
-