Class LicenseType

All Implemented Interfaces:
ILicenseType, IPrivilegeHolder, Serializable

@Entity public class LicenseType extends AbstractPrivilegeHolder implements ILicenseType, Serializable
This class describes license types for record access conditions and also system user roles (not to be confused with the class Role, however), also known as core license types.
See Also:
  • Field Details

    • LICENSE_TYPE_SET_REPRESENTATIVE_IMAGE

      public static final String LICENSE_TYPE_SET_REPRESENTATIVE_IMAGE
      Constant LICENSE_TYPE_SET_REPRESENTATIVE_IMAGE="licenseType_setRepresentativeImage"
      See Also:
    • LICENSE_TYPE_DELETE_OCR_PAGE

      public static final String LICENSE_TYPE_DELETE_OCR_PAGE
      Constant LICENSE_TYPE_DELETE_OCR_PAGE="licenseType_deleteOcrPage"
      See Also:
    • LICENSE_TYPE_CMS

      public static final String LICENSE_TYPE_CMS
      Constant LICENSE_TYPE_CMS="licenseType_cms"
      See Also:
  • Constructor Details

    • LicenseType

      public LicenseType()
      Empty constructor.
    • LicenseType

      public LicenseType(String name)
      Parameters:
      name - License type name
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getId

      public Long getId()

      Getter for the field id.

      Returns:
      the id
    • setId

      public void setId(Long id)

      Setter for the field id.

      Parameters:
      id - the id to set
    • getName

      public String getName()

      Getter for the field name.

      Specified by:
      getName in interface ILicenseType
      Returns:
      the name
    • setName

      public void setName(String name)

      Setter for the field name.

      Parameters:
      name - the name to set
    • getDescription

      public String getDescription()

      Getter for the field description.

      Returns:
      the description
    • setDescription

      public void setDescription(String description)

      Setter for the field description.

      Parameters:
      description - the description to set
    • getMatch

      public String getMatch(String conditions, String pattern)

      getMatch.

      Parameters:
      conditions - a String object.
      pattern - a String object.
      Returns:
      a String object.
    • isCmsType

      public boolean isCmsType()

      isCmsType.

      Returns:
      true if this license type has one of the static CMS type names; false otherwise
    • isLegalDisclaimerType

      public boolean isLegalDisclaimerType()

      isCmsType.

      Returns:
      true if this license type has one of the static CMS type names; false otherwise
    • isUgcType

      public boolean isUgcType()
      Checks whether only Solr documents of the UGC type have the access condition upon which this license type is based.
      Returns:
      the ugcType
      Throws:
      IndexUnreachableException
      PresentationException
    • isOpenAccess

      public boolean isOpenAccess()

      isOpenAccess.

      Returns:
      the openAccess
    • setOpenAccess

      public void setOpenAccess(boolean openAccess)

      Setter for the field openAccess.

      Parameters:
      openAccess - the openAccess to set
    • isCore

      public boolean isCore()

      isCore.

      Returns:
      the core
    • setCore

      public void setCore(boolean core)

      Setter for the field core.

      Parameters:
      core - the core to set
    • isMovingWall

      public boolean isMovingWall()
      Returns:
      the movingWall
    • setMovingWall

      public void setMovingWall(boolean movingWall)
      Parameters:
      movingWall - the movingWall to set
    • isPdfDownloadQuota

      public boolean isPdfDownloadQuota()
      Returns:
      the pdfDownloadQuota
    • setPdfDownloadQuota

      public void setPdfDownloadQuota(boolean pdfDownloadQuota)
      Parameters:
      pdfDownloadQuota - the pdfDownloadQuota to set
    • isConcurrentViewsLimit

      public boolean isConcurrentViewsLimit()
      Returns:
      the concurrentViewsLimit
    • setConcurrentViewsLimit

      public void setConcurrentViewsLimit(boolean concurrentViewsLimit)
      Parameters:
      concurrentViewsLimit - the concurrentViewsLimit to set
    • isRedirect

      public boolean isRedirect()
      Returns:
      the redirect
    • setRedirect

      public void setRedirect(boolean redirect)
      Parameters:
      redirect - the redirect to set
    • getRedirectUrl

      public String getRedirectUrl()
      Returns:
      the redirectUrl
    • setRedirectUrl

      public void setRedirectUrl(String redirectUrl)
      Parameters:
      redirectUrl - the redirectUrl to set
    • getPrivileges

      public Set<String> getPrivileges()

      Getter for the field privileges.

      Returns:
      the privileges
    • getAvailablePrivileges

      public List<String> getAvailablePrivileges()
      Returns the list of available privileges for adding to this license (using the working copy while editing).
      Returns:
      Values in IPrivilegeHolder.PRIVS_RECORD minus the privileges already added
    • getAvailablePrivileges

      public List<String> getAvailablePrivileges(Set<String> privileges)
      Returns the list of available privileges for adding to this license (using the given privileges list).
      Parameters:
      privileges - Privileges to be removed from the returned list
      Returns:
      Values in IPrivilegeHolder.PRIVS_RECORD minus the privileges already added
    • getSortedPrivileges

      public List<String> getSortedPrivileges(Set<String> privileges)
      Returns a sorted list (according to PRIVS_RECORD) based on the given set of privileges.
      Specified by:
      getSortedPrivileges in interface IPrivilegeHolder
      Returns:
      Sorted list of privileges contained in privileges
    • setPrivileges

      public void setPrivileges(Set<String> privileges)

      Setter for the field privileges.

      Parameters:
      privileges - the privileges to set
    • addPrivilege

      public boolean addPrivilege(String privilege)
      Adds the given privilege to the working set.
      Specified by:
      addPrivilege in interface IPrivilegeHolder
      Parameters:
      privilege -
      Returns:
      true if successful; false otherwise
    • removePrivilege

      public boolean removePrivilege(String privilege)
      Removes the given privilege from the working set.
      Specified by:
      removePrivilege in interface IPrivilegeHolder
      Parameters:
      privilege -
      Returns:
      true if successful; false otherwise
    • hasPrivilege

      public boolean hasPrivilege(String privilege)

      hasPrivilege.

      Specified by:
      hasPrivilege in interface IPrivilegeHolder
      Parameters:
      privilege - a String object.
      Returns:
      a boolean.
    • hasPrivilegeCopy

      public boolean hasPrivilegeCopy(String privilege)
      Checks whether this license type has the given privilege in the working copy of the privilege list.
      Parameters:
      privilege - Privilege name to check
      Returns:
      true if copy contains privilege; false otherwise
    • isPrivCmsPages

      public boolean isPrivCmsPages()

      isPrivCmsPages.

      Specified by:
      isPrivCmsPages in interface IPrivilegeHolder
      Returns:
      a boolean.
    • setPrivCmsPages

      public void setPrivCmsPages(boolean priv)

      setPrivCmsPages.

      Specified by:
      setPrivCmsPages in interface IPrivilegeHolder
      Parameters:
      priv - a boolean.
    • isPrivCmsAllSubthemes

      public boolean isPrivCmsAllSubthemes()

      isPrivCmsAllSubthemes.

      Specified by:
      isPrivCmsAllSubthemes in interface IPrivilegeHolder
      Returns:
      a boolean.
    • setPrivCmsAllSubthemes

      public void setPrivCmsAllSubthemes(boolean priv)

      setPrivCmsAllSubthemes.

      Specified by:
      setPrivCmsAllSubthemes in interface IPrivilegeHolder
      Parameters:
      priv - a boolean.
    • isPrivCmsAllCategories

      public boolean isPrivCmsAllCategories()

      isPrivCmsAllCategories.

      Specified by:
      isPrivCmsAllCategories in interface IPrivilegeHolder
      Returns:
      a boolean.
    • setPrivCmsAllCategories

      public void setPrivCmsAllCategories(boolean priv)

      setPrivCmsAllCategories.

      Specified by:
      setPrivCmsAllCategories in interface IPrivilegeHolder
      Parameters:
      priv - a boolean.
    • isPrivCmsAllTemplates

      public boolean isPrivCmsAllTemplates()

      isPrivCmsAllTemplates.

      Specified by:
      isPrivCmsAllTemplates in interface IPrivilegeHolder
      Returns:
      a boolean.
    • setPrivCmsAllTemplates

      public void setPrivCmsAllTemplates(boolean priv)

      setPrivCmsAllTemplates.

      Specified by:
      setPrivCmsAllTemplates in interface IPrivilegeHolder
      Parameters:
      priv - a boolean.
    • isPrivCmsMenu

      public boolean isPrivCmsMenu()

      isPrivCmsMenu.

      Specified by:
      isPrivCmsMenu in interface IPrivilegeHolder
      Returns:
      a boolean.
    • setPrivCmsMenu

      public void setPrivCmsMenu(boolean priv)

      setPrivCmsMenu.

      Specified by:
      setPrivCmsMenu in interface IPrivilegeHolder
      Parameters:
      priv - a boolean.
    • isPrivCmsStaticPages

      public boolean isPrivCmsStaticPages()

      isPrivCmsStaticPages.

      Specified by:
      isPrivCmsStaticPages in interface IPrivilegeHolder
      Returns:
      a boolean.
    • setPrivCmsStaticPages

      public void setPrivCmsStaticPages(boolean priv)

      setPrivCmsStaticPages.

      Specified by:
      setPrivCmsStaticPages in interface IPrivilegeHolder
      Parameters:
      priv - a boolean.
    • isPrivCmsCollections

      public boolean isPrivCmsCollections()

      isPrivCmsCollections.

      Specified by:
      isPrivCmsCollections in interface IPrivilegeHolder
      Returns:
      a boolean.
    • setPrivCmsCollections

      public void setPrivCmsCollections(boolean priv)

      setPrivCmsCollections.

      Specified by:
      setPrivCmsCollections in interface IPrivilegeHolder
      Parameters:
      priv - a boolean.
    • isPrivCmsCategories

      public boolean isPrivCmsCategories()

      isPrivCmsCategories.

      Specified by:
      isPrivCmsCategories in interface IPrivilegeHolder
      Returns:
      a boolean.
    • setPrivCmsCategories

      public void setPrivCmsCategories(boolean priv)

      setPrivCmsCategories.

      Specified by:
      setPrivCmsCategories in interface IPrivilegeHolder
      Parameters:
      priv - a boolean.
    • isPrivCrowdsourcingAllCampaigns

      public boolean isPrivCrowdsourcingAllCampaigns()

      isPrivCrowdsourcingAllCampaigns.

      Specified by:
      isPrivCrowdsourcingAllCampaigns in interface IPrivilegeHolder
      Returns:
      a boolean.
    • setPrivCrowdsourcingAllCampaigns

      public void setPrivCrowdsourcingAllCampaigns(boolean priv)

      setPrivCrowdsourcingAllCampaigns.

      Specified by:
      setPrivCrowdsourcingAllCampaigns in interface IPrivilegeHolder
      Parameters:
      priv - a boolean.
    • isPrivCrowdsourcingAnnotateCampaign

      public boolean isPrivCrowdsourcingAnnotateCampaign()

      isPrivCrowdsourcingAnnotateCampaign.

      Specified by:
      isPrivCrowdsourcingAnnotateCampaign in interface IPrivilegeHolder
      Returns:
      a boolean.
    • setPrivCrowdsourcingAnnotateCampaign

      public void setPrivCrowdsourcingAnnotateCampaign(boolean priv)

      setPrivCrowdsourcingAnnotateCampaign.

      Specified by:
      setPrivCrowdsourcingAnnotateCampaign in interface IPrivilegeHolder
      Parameters:
      priv - a boolean.
    • isPrivCrowdsourcingReviewCampaign

      public boolean isPrivCrowdsourcingReviewCampaign()

      isPrivCrowdsourcingReviewCampaign.

      Specified by:
      isPrivCrowdsourcingReviewCampaign in interface IPrivilegeHolder
      Returns:
      a boolean.
    • setPrivCrowdsourcingReviewCampaign

      public void setPrivCrowdsourcingReviewCampaign(boolean priv)

      setPrivCrowdsourcingReviewCampaign.

      Specified by:
      setPrivCrowdsourcingReviewCampaign in interface IPrivilegeHolder
      Parameters:
      priv - a boolean.
    • isPrivViewUgc

      public boolean isPrivViewUgc()
      Description copied from interface: IPrivilegeHolder

      isPrivViewUgc.

      Specified by:
      isPrivViewUgc in interface IPrivilegeHolder
      Returns:
      a boolean.
    • setPrivViewUgc

      public void setPrivViewUgc(boolean priv)
      Description copied from interface: IPrivilegeHolder

      setPrivViewUgc.

      Specified by:
      setPrivViewUgc in interface IPrivilegeHolder
      Parameters:
      priv - a boolean.
    • getOverriddenLicenseTypes

      public Set<LicenseType> getOverriddenLicenseTypes()

      Getter for the field overridingLicenseTypes.

      Returns:
      the overridsenLicenseTypes
    • setOverriddenLicenseTypes

      public void setOverriddenLicenseTypes(Set<LicenseType> overriddenLicenseTypes)

      Setter for the field overriddenLicenseTypes.

      Parameters:
      overriddenLicenseTypes - the overriddenLicenseTypes to set
    • getLicenseTypesOverridingThis

      public List<LicenseType> getLicenseTypesOverridingThis() throws DAOException
      Returns list of LicenseTypes that contain this object in their overridden LicenseTypes.
      Returns:
      List
      Throws:
      DAOException
    • getPrivilegesCopy

      public Set<String> getPrivilegesCopy()
      Returns:
      the privilegesCopy
    • setPrivilegesCopy

      public void setPrivilegesCopy(Set<String> privilegesCopy)
      Parameters:
      privilegesCopy - the privilegesCopy to set
    • isRestrictionsExpired

      public boolean isRestrictionsExpired(String query)
      Parameters:
      query -
      Returns:
      true if the configured restriction query is expired; false otherwise
    • getRestrictionsExpired

      public Map<String,Boolean> getRestrictionsExpired()
      Returns:
      the restrictionsExpired
    • setRestrictionsExpired

      public void setRestrictionsExpired(Map<String,Boolean> restrictionsExpired)
      Parameters:
      restrictionsExpired - the restrictionsExpired to set
    • addCoreLicenseTypesToDB

      public static void addCoreLicenseTypesToDB() throws DAOException

      addCoreLicenseTypesToDB.

      Throws:
      DAOException - if any.
    • getFilterQueryPart

      public String getFilterQueryPart()
      Returns:
      Solr query for the access condition name
    • getMovingWallFilterQueryPart

      public String getMovingWallFilterQueryPart()
      Returns:
      Solr query for the moving wall
    • toString

      public String toString()
      Overrides:
      toString in class Object