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
-
Method Summary
Modifier and TypeMethodDescriptiondeleteLicenseAction
(License license) deleteLicenseAction.deleteLicenseTypeAction
(LicenseType licenseType) deleteLicenseTypeAction.getAllCoreLicenseTypes.Returns all existing license types.getAllRecordLicenseTypes.long
getConcurrentViewsLimitRecordCountForLicenseType
(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<javax.faces.model.SelectItem>
Getter for the fieldlazyModelDownloadTickets
.getLicenses
(LicenseType licenseType) getMessageKeyForPrivilege
(String privilege) long
getNumRecordsWithAccessCondition
(String accessCondition) Returns all existing non-core license types minuscurrentLicenseType
.getPageDownloadTickets.long
getPdfQuotaRecordCountForLicenseType
(String licenseTypeName) Queries Solr for a list of all values of the set ACCESSCONDITIONgetUrlQueryForAccessCondition
(String accessCondition) void
init()
init.boolean
isLicenseTypeInUse
(LicenseType licenseType) void
CreatescurrentLicense
to a new instance.void
newCurrentLicenseTypeAction.void
resetCurrentRoleLicenseAction.Adds the current License to the licensee (User, UserGroup or IpRange).saveLicenseTypeAction.void
setCurrentLicense
(License currentLicense) Setter for the fieldcurrentLicense
.void
SetscurrentLicense
by loading it from the DB via the given ID.void
setCurrentLicenseType
(LicenseType currentLicenseType) Setter for the fieldcurrentLicenseType
.void
SetscurrentUserGroup
by loading it from the DB via the given ID.void
setCurrentRole
(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
List
object. - Throws:
DAOException
- if any.
-
saveCurrentLicenseTypeAction
saveLicenseTypeAction.
- Returns:
- a
String
object. - Throws:
DAOException
- if any.
-
deleteLicenseTypeAction
deleteLicenseTypeAction.
- Parameters:
licenseType
- aLicenseType
object.- 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:
IndexUnreachableException
PresentationException
-
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:
IndexUnreachableException
PresentationException
-
getLicenses
- Parameters:
licenseType
-- Returns:
- Number of licenses with of given
LicenseType
- Throws:
DAOException
-
newCurrentLicenseAction
public void newCurrentLicenseAction()Creates
currentLicense
to a new instance. -
saveCurrentLicenseAction
public String saveCurrentLicenseAction() throws DAOException, IndexUnreachableException, PresentationExceptionAdds 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.DAOException
IndexUnreachableException
PresentationException
-
deleteLicenseAction
deleteLicenseAction.
- Parameters:
license
- aLicense
object.- Returns:
- a
String
object. - Throws:
DAOException
- if any.
-
getLazyModelDownloadTickets
Getter for the field
lazyModelDownloadTickets
.- Returns:
- the lazyModelDownloadTickets
-
getPageDownloadTickets
getPageDownloadTickets.
- Returns:
- a
List
object.
-
getDownloadTicketRequests
- Returns:
- List of existing download tickets that are in request status
- Throws:
DAOException
-
activateDownloadTicketAction
- Parameters:
ticket
-- Returns:
- Navigation outcome
- Throws:
DAOException
-
extendDownloadTicketAction
- Parameters:
ticket
-- Returns:
- Navigation outcome
- Throws:
DAOException
-
renewDownloadTicketAction
- Parameters:
ticket
-- Returns:
- Navigation outcome
- Throws:
DAOException
-
rejectDownloadTicketAction
- Parameters:
ticket
-- Returns:
- Navigation outcome
- Throws:
DAOException
-
deleteDownloadTicketAction
- 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.id
if loaded and has ID; null if not
-
setCurrentLicenseTypeId
SetscurrentUserGroup
by 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.id
if loaded and has ID; null if not
-
setCurrentLicenseId
SetscurrentLicense
by loading it from the DB via the given ID.- Parameters:
id
-- Throws:
DAOException
-
getPossibleAccessConditions
public List<String> getPossibleAccessConditions() throws IndexUnreachableException, PresentationExceptionQueries Solr for a list of all values of the set ACCESSCONDITION- Returns:
- A list of all indexed ACCESSCONDITIONs
- Throws:
IndexUnreachableException
- if any.PresentationException
- if any.
-
getNotConfiguredAccessConditions
- Returns:
- List of access condition values that have no corresponding license type in the database
- Throws:
IndexUnreachableException
PresentationException
DAOException
-
getNumRecordsWithAccessCondition
public long getNumRecordsWithAccessCondition(String accessCondition) throws IndexUnreachableException, PresentationException - Parameters:
accessCondition
-- Returns:
- Number of records containing the given access condition value
- Throws:
PresentationException
IndexUnreachableException
-
getUrlQueryForAccessCondition
- Parameters:
accessCondition
-- Returns:
- Generated query for given accessCondition
-
getMessageKeyForPrivilege
- Parameters:
privilege
-- Returns:
- Composite message key for the given privilege name
-