Class License
- All Implemented Interfaces:
IPrivilegeHolder,Serializable
License class.
- See Also:
-
Field Summary
Fields inherited from class io.goobi.viewer.model.security.AbstractPrivilegeHolder
PRIVS_CMS, PRIVS_RECORDFields inherited from interface io.goobi.viewer.model.security.IPrivilegeHolder
PREFIX_PRIV, PREFIX_TICKET, PRIV_ARCHIVE_DISPLAY_NODE, PRIV_CMS_ALL_CATEGORIES, PRIV_CMS_ALL_SUBTHEMES, PRIV_CMS_ALL_TEMPLATES, PRIV_CMS_CATEGORIES, PRIV_CMS_COLLECTIONS, PRIV_CMS_MENU, PRIV_CMS_PAGES, PRIV_CMS_STATIC_PAGES, PRIV_CROWDSOURCING_ALL_CAMPAIGNS, PRIV_CROWDSOURCING_ANNOTATE_CAMPAIGN, PRIV_CROWDSOURCING_REVIEW_CAMPAIGN, PRIV_DELETE_OCR_PAGE, PRIV_DOWNLOAD_BORN_DIGITAL_FILES, PRIV_DOWNLOAD_IMAGES, PRIV_DOWNLOAD_METADATA, PRIV_DOWNLOAD_ORIGINAL_CONTENT, PRIV_DOWNLOAD_PAGE_PDF, PRIV_DOWNLOAD_PDF, PRIV_GENERATE_IIIF_MANIFEST, PRIV_LEGAL_DISCLAIMER, PRIV_LIST, PRIV_SET_REPRESENTATIVE_IMAGE, PRIV_VIEW_AUDIO, PRIV_VIEW_CMS, PRIV_VIEW_FULLTEXT, PRIV_VIEW_IMAGES, PRIV_VIEW_METADATA, PRIV_VIEW_THUMBNAILS, PRIV_VIEW_UGC, PRIV_VIEW_VIDEO, PRIV_ZOOM_IMAGES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddPrivilege(String privilege) Adds the given privilege to the working set.booleanGetter for the fieldallowedCategories.Getter for the fieldallowedCmsTemplates.Getter for the fieldallowedCrowdsourcingCampaigns.Returns the list of available record privileges for adding to this license (using the working copy while editing).getAvailablePrivileges(Set<String> privileges) Returns the list of available record privileges for adding to this license (using the given privileges list).Getter for the fieldconditions.Getter for the fielddescription.Convenience method for disabling the save button.getEnd()Getter for the fieldend.getId()Getter for the fieldid.Getter for the fieldipRange.Getter for the fieldlicenseType.Getter for the fieldprivileges.getSortedPrivileges(Set<String> privileges) Returns a sorted list (according to the static array of privileges, either for records or CMS) based on the given set of privileges.getStart()Getter for the fieldstart.Getter for the fieldsubthemeDiscriminatorValues.getType()getUser()Getter for the fielduser.Getter for the fielduserGroup.inthashCode()booleanhasPrivilege(String privilege) hasPrivilege.booleanbooleanisPrivCmsAllCategories.booleanisPrivCmsAllSubthemes.booleanisPrivCmsAllTemplates.booleanisPrivCmsCategories.booleanisPrivCmsCollections.booleanisPrivCmsMenu.booleanisPrivCmsPages.booleanisPrivCmsStaticPages.booleanisPrivCrowdsourcingAllCampaigns.booleanisPrivCrowdsourcingAnnotateCampaign.booleanisPrivCrowdsourcingReviewCampaign.booleanisPrivViewUgc.booleanbooleanisValid()Checks the validity of this license.booleanremovePrivilege(String privilege) Removes the given privilege from the working set.voidResets all working copies of lists of various privileges.voidsetAllowedCategories(List<CMSCategory> allowedCategories) Setter for the fieldallowedCategories.voidsetAllowedCmsTemplates(List<CMSPageTemplate> allowedCmsTemplates) Setter for the fieldallowedCmsTemplates.voidsetAllowedCrowdsourcingCampaigns(List<Campaign> allowedCrowdsourcingCampaigns) Setter for the fieldallowedCrowdsourcingCampaigns.voidsetClient(ClientApplication client) voidsetClientId(Long clientId) voidsetConditions(String conditions) Setter for the fieldconditions.voidsetDescription(String description) Setter for the fielddescription.voidsetEnd(LocalDateTime end) Setter for the fieldend.voidSetter for the fieldid.voidsetIpRange(IpRange ipRange) Setter for the fieldipRange.voidsetLicenseType(LicenseType licenseType) Setter for the fieldlicenseType.voidsetPrivCmsAllCategories(boolean priv) setPrivCmsAllCategories.voidsetPrivCmsAllSubthemes(boolean priv) setPrivCmsAllSubthemes.voidsetPrivCmsAllTemplates(boolean priv) setPrivCmsAllTemplates.voidsetPrivCmsCategories(boolean priv) setPrivCmsCategories.voidsetPrivCmsCollections(boolean priv) setPrivCmsCollections.voidsetPrivCmsMenu(boolean priv) setPrivCmsMenu.voidsetPrivCmsPages(boolean priv) setPrivCmsPages.voidsetPrivCmsStaticPages(boolean priv) setPrivCmsStaticPages.voidsetPrivCrowdsourcingAllCampaigns(boolean priv) setPrivCrowdsourcingAllCampaigns.voidsetPrivCrowdsourcingAnnotateCampaign(boolean priv) setPrivCrowdsourcingAnnotateCampaign.voidsetPrivCrowdsourcingReviewCampaign(boolean priv) setPrivCrowdsourcingReviewCampaign.voidsetPrivileges(Set<String> privileges) Setter for the fieldprivileges.voidsetPrivilegesCopy(Set<String> privilegesCopy) voidsetPrivViewUgc(boolean priv) setPrivViewUgc.voidsetStart(LocalDateTime start) Setter for the fieldstart.voidsetSubthemeDiscriminatorValues(List<String> subthemeDiscriminatorValues) Setter for the fieldsubthemeDiscriminatorValues.voidsetTicketRequired(boolean ticketRequired) voidvoidSetter for the fielduser.voidsetUserGroup(UserGroup userGroup) Setter for the fielduserGroup.
-
Constructor Details
-
License
public License()
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
isValid
public boolean isValid()Checks the validity of this license. A valid license is either not time limited (start and/or end) or the current date lies between the license's start and and dates.- Returns:
- true if valid; false otherwise;
-
addPrivilege
Adds the given privilege to the working set.- Specified by:
addPrivilegein interfaceIPrivilegeHolder- Parameters:
privilege-- Returns:
- true if successful; false otherwise
-
removePrivilege
Removes the given privilege from the working set.- Specified by:
removePrivilegein interfaceIPrivilegeHolder- Parameters:
privilege-- Returns:
- true if successful; false otherwise
-
hasPrivilege
hasPrivilege.
- Specified by:
hasPrivilegein interfaceIPrivilegeHolder- Parameters:
privilege- aStringobject.- Returns:
- a boolean.
-
isPrivCmsPages
public boolean isPrivCmsPages()isPrivCmsPages.
- Specified by:
isPrivCmsPagesin interfaceIPrivilegeHolder- Returns:
- a boolean.
-
setPrivCmsPages
public void setPrivCmsPages(boolean priv) setPrivCmsPages.
- Specified by:
setPrivCmsPagesin interfaceIPrivilegeHolder- Parameters:
priv- a boolean.
-
isPrivCmsAllSubthemes
public boolean isPrivCmsAllSubthemes()isPrivCmsAllSubthemes.
- Specified by:
isPrivCmsAllSubthemesin interfaceIPrivilegeHolder- Returns:
- a boolean.
-
setPrivCmsAllSubthemes
public void setPrivCmsAllSubthemes(boolean priv) setPrivCmsAllSubthemes.
- Specified by:
setPrivCmsAllSubthemesin interfaceIPrivilegeHolder- Parameters:
priv- a boolean.
-
isPrivCmsAllCategories
public boolean isPrivCmsAllCategories()isPrivCmsAllCategories.
- Specified by:
isPrivCmsAllCategoriesin interfaceIPrivilegeHolder- Returns:
- a boolean.
-
setPrivCmsAllCategories
public void setPrivCmsAllCategories(boolean priv) setPrivCmsAllCategories.
- Specified by:
setPrivCmsAllCategoriesin interfaceIPrivilegeHolder- Parameters:
priv- a boolean.
-
isPrivCmsAllTemplates
public boolean isPrivCmsAllTemplates()isPrivCmsAllTemplates.
- Specified by:
isPrivCmsAllTemplatesin interfaceIPrivilegeHolder- Returns:
- a boolean.
-
setPrivCmsAllTemplates
public void setPrivCmsAllTemplates(boolean priv) setPrivCmsAllTemplates.
- Specified by:
setPrivCmsAllTemplatesin interfaceIPrivilegeHolder- Parameters:
priv- a boolean.
-
isPrivCmsMenu
public boolean isPrivCmsMenu()isPrivCmsMenu.
- Specified by:
isPrivCmsMenuin interfaceIPrivilegeHolder- Returns:
- a boolean.
-
setPrivCmsMenu
public void setPrivCmsMenu(boolean priv) setPrivCmsMenu.
- Specified by:
setPrivCmsMenuin interfaceIPrivilegeHolder- Parameters:
priv- a boolean.
-
isPrivCmsStaticPages
public boolean isPrivCmsStaticPages()isPrivCmsStaticPages.
- Specified by:
isPrivCmsStaticPagesin interfaceIPrivilegeHolder- Returns:
- a boolean.
-
setPrivCmsStaticPages
public void setPrivCmsStaticPages(boolean priv) setPrivCmsStaticPages.
- Specified by:
setPrivCmsStaticPagesin interfaceIPrivilegeHolder- Parameters:
priv- a boolean.
-
isPrivCmsCollections
public boolean isPrivCmsCollections()isPrivCmsCollections.
- Specified by:
isPrivCmsCollectionsin interfaceIPrivilegeHolder- Returns:
- a boolean.
-
setPrivCmsCollections
public void setPrivCmsCollections(boolean priv) setPrivCmsCollections.
- Specified by:
setPrivCmsCollectionsin interfaceIPrivilegeHolder- Parameters:
priv- a boolean.
-
isPrivCmsCategories
public boolean isPrivCmsCategories()isPrivCmsCategories.
- Specified by:
isPrivCmsCategoriesin interfaceIPrivilegeHolder- Returns:
- a boolean.
-
setPrivCmsCategories
public void setPrivCmsCategories(boolean priv) setPrivCmsCategories.
- Specified by:
setPrivCmsCategoriesin interfaceIPrivilegeHolder- Parameters:
priv- a boolean.
-
isPrivCrowdsourcingAllCampaigns
public boolean isPrivCrowdsourcingAllCampaigns()isPrivCrowdsourcingAllCampaigns.
- Specified by:
isPrivCrowdsourcingAllCampaignsin interfaceIPrivilegeHolder- Returns:
- a boolean.
-
setPrivCrowdsourcingAllCampaigns
public void setPrivCrowdsourcingAllCampaigns(boolean priv) setPrivCrowdsourcingAllCampaigns.
- Specified by:
setPrivCrowdsourcingAllCampaignsin interfaceIPrivilegeHolder- Parameters:
priv- a boolean.
-
isPrivCrowdsourcingAnnotateCampaign
public boolean isPrivCrowdsourcingAnnotateCampaign()isPrivCrowdsourcingAnnotateCampaign.
- Specified by:
isPrivCrowdsourcingAnnotateCampaignin interfaceIPrivilegeHolder- Returns:
- a boolean.
-
setPrivCrowdsourcingAnnotateCampaign
public void setPrivCrowdsourcingAnnotateCampaign(boolean priv) setPrivCrowdsourcingAnnotateCampaign.
- Specified by:
setPrivCrowdsourcingAnnotateCampaignin interfaceIPrivilegeHolder- Parameters:
priv- a boolean.
-
isPrivCrowdsourcingReviewCampaign
public boolean isPrivCrowdsourcingReviewCampaign()isPrivCrowdsourcingReviewCampaign.
- Specified by:
isPrivCrowdsourcingReviewCampaignin interfaceIPrivilegeHolder- Returns:
- a boolean.
-
setPrivCrowdsourcingReviewCampaign
public void setPrivCrowdsourcingReviewCampaign(boolean priv) setPrivCrowdsourcingReviewCampaign.
- Specified by:
setPrivCrowdsourcingReviewCampaignin interfaceIPrivilegeHolder- Parameters:
priv- a boolean.
-
isPrivViewUgc
public boolean isPrivViewUgc()Description copied from interface:IPrivilegeHolderisPrivViewUgc.
- Specified by:
isPrivViewUgcin interfaceIPrivilegeHolder- Returns:
- a boolean.
-
setPrivViewUgc
public void setPrivViewUgc(boolean priv) Description copied from interface:IPrivilegeHoldersetPrivViewUgc.
- Specified by:
setPrivViewUgcin interfaceIPrivilegeHolder- Parameters:
priv- a boolean.
-
resetTempData
public void resetTempData()Resets all working copies of lists of various privileges. -
getAvailablePrivileges
Returns the list of available record privileges for adding to this license (using the working copy while editing).- Returns:
- Values in IPrivilegeHolder.PRIVS_RECORD minus the privileges already added
-
getAvailablePrivileges
Returns the list of available record privileges for adding to this license (using the given privileges list).- Parameters:
privileges-- Returns:
- Values in IPrivilegeHolder.PRIVS_RECORD minus the privileges already added
-
getSortedPrivileges
Returns a sorted list (according to the static array of privileges, either for records or CMS) based on the given set of privileges.- Specified by:
getSortedPrivilegesin interfaceIPrivilegeHolder- Parameters:
privileges- Listed privileges- Returns:
- Sorted list of privileges contained in
privileges
-
getSelectableSubthemes
- Returns:
- List<Selectablei<String>>
- Throws:
DAOExceptionPresentationException
-
getSelectableCategories
- Returns:
- List<Selectable<CMSCategory>>
- Throws:
DAOException
-
getSelectableTemplates
- Returns:
- List<Selectable<CMSPageTemplate>>
- Throws:
DAOException
-
getId
Getter for the field
id.- Returns:
- the id
-
setId
Setter for the field
id.- Parameters:
id- the id to set
-
getLicenseType
Getter for the field
licenseType.- Returns:
- the licenseType
-
setLicenseType
Setter for the field
licenseType.- Parameters:
licenseType- the licenseType to set
-
getUser
Getter for the field
user.- Returns:
- the user
-
setUser
Setter for the field
user.- Parameters:
user- the user to set
-
getUserGroup
Getter for the field
userGroup.- Returns:
- the userGroup
-
setUserGroup
Setter for the field
userGroup.- Parameters:
userGroup- the userGroup to set
-
getIpRange
Getter for the field
ipRange.- Returns:
- the ipRange
-
setIpRange
Setter for the field
ipRange.- Parameters:
ipRange- the ipRange to set
-
getStart
Getter for the field
start.- Returns:
- the start
-
setStart
Setter for the field
start.- Parameters:
start- the start to set
-
getEnd
Getter for the field
end.- Returns:
- the end
-
setEnd
Setter for the field
end.- Parameters:
end- the end to set
-
getPrivileges
Getter for the field
privileges.- Returns:
- the privileges
-
setPrivileges
Setter for the field
privileges.- Parameters:
privileges- the privileges to set
-
getConditions
Getter for the field
conditions.- Returns:
- the conditions
-
setConditions
Setter for the field
conditions.- Parameters:
conditions- the conditions to set
-
getDescription
Getter for the field
description.- Returns:
- the description
-
setDescription
Setter for the field
description.- Parameters:
description- the description to set
-
isTicketRequired
public boolean isTicketRequired()- Returns:
- the ticketRequired
-
setTicketRequired
public void setTicketRequired(boolean ticketRequired) - Parameters:
ticketRequired- the ticketRequired to set
-
isDisplayTicketRequiredToggle
public boolean isDisplayTicketRequiredToggle()- Returns:
- true if privilege PRIV_DOWNLOAD_BORN_DIGITAL_FILES is contained; false otherwise
-
getSubthemeDiscriminatorValues
Getter for the field
subthemeDiscriminatorValues.- Returns:
- the subthemeDiscriminatorValues
-
setSubthemeDiscriminatorValues
Setter for the field
subthemeDiscriminatorValues.- Parameters:
subthemeDiscriminatorValues- the subthemeDiscriminatorValues to set
-
getAllowedCategories
Getter for the field
allowedCategories.- Returns:
- the allowedCategories
-
setAllowedCategories
Setter for the field
allowedCategories.- Parameters:
allowedCategories- the allowedCategories to set
-
getAllowedCmsTemplates
Getter for the field
allowedCmsTemplates.- Returns:
- the allowedCmsTemplates
-
setAllowedCmsTemplates
Setter for the field
allowedCmsTemplates.- Parameters:
allowedCmsTemplates- the allowedCmsTemplates to set
-
getAllowedCrowdsourcingCampaigns
Getter for the field
allowedCrowdsourcingCampaigns.- Returns:
- the allowedCrowdsourcingCampaigns
-
setAllowedCrowdsourcingCampaigns
Setter for the field
allowedCrowdsourcingCampaigns.- Parameters:
allowedCrowdsourcingCampaigns- the allowedCrowdsourcingCampaigns to set
-
getType
- Returns:
- the type
-
setType
- Parameters:
type- the type to set
-
getPrivilegesCopy
- Returns:
- the privilegesCopy
-
setPrivilegesCopy
- Parameters:
privilegesCopy- the privilegesCopy to set
-
getDisclaimerScope
-
getClientId
- Returns:
- the client
-
getClient
-
setClient
- Parameters:
client- the client to set
-
setClientId
- Parameters:
clientId- the clientId to set- Throws:
DAOException
-
getDisabledStatus
Convenience method for disabling the save button.- Returns:
- "disabled" if any required values are missing; null otherwise
-