Interface IDAO

All Known Implementing Classes:
JPADAO

public interface IDAO
Central data-access interface for the Goobi viewer, defining all persistence operations for the application's domain objects. Covers users, user groups, roles, licenses, CMS pages and components, crowdsourcing campaigns, bookmarks, annotations, search history, geo-maps, upload jobs, message-queue entries, usage statistics, and more.
  • Method Details

    • tableExists

      boolean tableExists(String tableName) throws DAOException, SQLException
      tableExists.
      Parameters:
      tableName - name of the database table to check
      Returns:
      true if the table exists; false otherwise
      Throws:
      SQLException - if any.
      DAOException
    • columnsExists

      boolean columnsExists(String tableName, String columnName) throws DAOException, SQLException
      columnsExists.
      Parameters:
      tableName - name of the database table to check
      columnName - name of the column to check for existence
      Returns:
      true if the column exists in the table; false otherwise
      Throws:
      SQLException - if any.
      DAOException
    • getAllUsers

      List<User> getAllUsers(boolean refresh) throws DAOException
      getAllUsers.
      Parameters:
      refresh - true to bypass cache and reload from database
      Returns:
      list of all users in the database
      Throws:
      DAOException - if any.
    • getUserCount

      long getUserCount(Map<String,String> filters) throws DAOException
      getUserCount.
      Parameters:
      filters - map of field names to filter values
      Returns:
      total number of users matching the given filters
      Throws:
      DAOException - if any.
    • getUsers

      List<User> getUsers(int first, int pageSize, String sortField, boolean descending, Map<String,String> filters) throws DAOException
      getUsers.
      Parameters:
      first - index of first result (pagination)
      pageSize - max number of results to return
      sortField - field to sort by
      descending - true for descending sort order
      filters - map of field names to filter values
      Returns:
      list of users matching the given criteria
      Throws:
      DAOException - if any.
    • getUsersByPropertyValue

      List<User> getUsersByPropertyValue(String propertyName, String propertyValue) throws DAOException
      Parameters:
      propertyName - name of the user property to filter by
      propertyValue - value of the user property to filter by
      Returns:
      List if users with matching property name/value pair
      Throws:
      DAOException
    • getAdminUsers

      List<User> getAdminUsers() throws DAOException
      Returns:
      List where User.superuser == true
      Throws:
      DAOException
    • getUser

      User getUser(long id) throws DAOException
      getUser.
      Parameters:
      id - database primary key of the user
      Returns:
      the matching user, or null if not found
      Throws:
      DAOException - if any.
    • getUserByEmail

      User getUserByEmail(String email) throws DAOException
      getUserByEmail.
      Parameters:
      email - email address of the user to look up
      Returns:
      the matching user, or null if not found
      Throws:
      DAOException - if any.
    • getUserByOpenId

      User getUserByOpenId(String identifier) throws DAOException
      getUserByOpenId.
      Parameters:
      identifier - OpenID identifier of the user to look up
      Returns:
      the matching user, or null if not found
      Throws:
      DAOException - if any.
    • getUserByNickname

      User getUserByNickname(String nickname) throws DAOException
      getUserByNickname.
      Parameters:
      nickname - display name of the user to look up
      Returns:
      the matching user, or null if not found
      Throws:
      DAOException - if any.
    • addUser

      boolean addUser(User user) throws DAOException
      addUser.
      Parameters:
      user - user to persist
      Returns:
      true if user was added successfully; false otherwise
      Throws:
      DAOException - if any.
    • updateUser

      boolean updateUser(User user) throws DAOException
      updateUser.
      Parameters:
      user - user to update in the database
      Returns:
      true if user was updated successfully; false otherwise
      Throws:
      DAOException - if any.
    • deleteUser

      boolean deleteUser(User user) throws DAOException
      deleteUser.
      Parameters:
      user - user to delete from the database
      Returns:
      true if user was deleted successfully; false otherwise
      Throws:
      DAOException - if any.
    • getAllUserGroups

      List<UserGroup> getAllUserGroups() throws DAOException
      getAllUserGroups.
      Returns:
      list of all user groups in the database
      Throws:
      DAOException - if any.
    • getUserGroupCount

      long getUserGroupCount(Map<String,String> filters) throws DAOException
      getUserGroupCount.
      Parameters:
      filters - map of field names to filter values
      Returns:
      total number of user groups matching the given filters
      Throws:
      DAOException - if any.
    • getUserGroups

      List<UserGroup> getUserGroups(int first, int pageSize, String sortField, boolean descending, Map<String,String> filters) throws DAOException
      getUserGroups.
      Parameters:
      first - index of first result (pagination)
      pageSize - max number of results to return
      sortField - field to sort by
      descending - true for descending sort order
      filters - map of field names to filter values
      Returns:
      list of user groups matching the given criteria
      Throws:
      DAOException - if any.
    • getUserGroups

      List<UserGroup> getUserGroups(User owner) throws DAOException
      getUserGroups.
      Parameters:
      owner - user who owns the groups to retrieve
      Returns:
      list of user groups owned by the given user
      Throws:
      DAOException - if any.
    • getUserGroup

      UserGroup getUserGroup(long id) throws DAOException
      getUserGroup.
      Parameters:
      id - database primary key of the user group
      Returns:
      the matching user group, or null if not found
      Throws:
      DAOException - if any.
    • getUserGroup

      UserGroup getUserGroup(String name) throws DAOException
      getUserGroup.
      Parameters:
      name - name of the user group to look up
      Returns:
      the matching user group, or null if not found
      Throws:
      DAOException - if any.
    • addUserGroup

      boolean addUserGroup(UserGroup userGroup) throws DAOException
      addUserGroup.
      Parameters:
      userGroup - user group to persist
      Returns:
      true if user group was added successfully; false otherwise
      Throws:
      DAOException - if any.
    • updateUserGroup

      boolean updateUserGroup(UserGroup userGroup) throws DAOException
      updateUserGroup.
      Parameters:
      userGroup - user group to update in the database
      Returns:
      true if user group was updated successfully; false otherwise
      Throws:
      DAOException - if any.
    • deleteUserGroup

      boolean deleteUserGroup(UserGroup userGroup) throws DAOException
      deleteUserGroup.
      Parameters:
      userGroup - user group to delete from the database
      Returns:
      true if user group was deleted successfully; false otherwise
      Throws:
      DAOException - if any.
    • getAllBookmarkLists

      List<BookmarkList> getAllBookmarkLists() throws DAOException
      getAllBookmarkLists.
      Returns:
      list of all bookmark lists in the database
      Throws:
      DAOException - if any.
    • getPublicBookmarkLists

      List<BookmarkList> getPublicBookmarkLists() throws DAOException
      getPublicBookmarkLists.
      Returns:
      list of all publicly visible bookmark lists
      Throws:
      DAOException - if any.
    • getBookmarkLists

      List<BookmarkList> getBookmarkLists(User user) throws DAOException
      getBookmarkLists.
      Parameters:
      user - owner of the bookmark lists to retrieve
      Returns:
      list of bookmark lists owned by the given user
      Throws:
      DAOException - if any.
    • getBookmarkListCount

      long getBookmarkListCount(User user) throws DAOException
      Gets number of bookmark lists owned by the given user.
      Parameters:
      user - owner of the bookmark lists
      Returns:
      number of owned bookmark lists
      Throws:
      DAOException
    • getBookmarkList

      BookmarkList getBookmarkList(long id) throws DAOException
      getBookmarkList.
      Parameters:
      id - database primary key of the bookmark list
      Returns:
      the matching bookmark list, or null if not found
      Throws:
      DAOException - if any.
    • getBookmarkList

      BookmarkList getBookmarkList(String name, User user) throws DAOException
      getBookmarkList.
      Parameters:
      name - name of the bookmark list to look up
      user - owner of the bookmark list
      Returns:
      the matching bookmark list, or null if not found
      Throws:
      DAOException - if any.
    • getBookmarkListByShareKey

      BookmarkList getBookmarkListByShareKey(String shareKey) throws DAOException
      getBookmarkListByShareKey.
      Parameters:
      shareKey - share key identifying the bookmark list
      Returns:
      the matching bookmark list, or null if not found
      Throws:
      DAOException - if any.
    • addBookmarkList

      boolean addBookmarkList(BookmarkList bookmarkList) throws DAOException
      addBookmarkList.
      Parameters:
      bookmarkList - bookmark list to persist
      Returns:
      true if bookmark list was added successfully; false otherwise
      Throws:
      DAOException - if any.
    • updateBookmarkList

      boolean updateBookmarkList(BookmarkList bookmarkList) throws DAOException
      updateBookmarkList.
      Parameters:
      bookmarkList - bookmark list to update in the database
      Returns:
      true if bookmark list was updated successfully; false otherwise
      Throws:
      DAOException - if any.
    • deleteBookmarkList

      boolean deleteBookmarkList(BookmarkList bookmarkList) throws DAOException
      deleteBookmarkList.
      Parameters:
      bookmarkList - bookmark list to delete from the database
      Returns:
      true if bookmark list was deleted successfully; false otherwise
      Throws:
      DAOException - if any.
    • getAllRoles

      List<Role> getAllRoles() throws DAOException
      getAllRoles.
      Returns:
      list of all roles in the database
      Throws:
      DAOException - if any.
    • getRoleCount

      long getRoleCount(Map<String,String> filters) throws DAOException
      getRoleCount.
      Parameters:
      filters - map of field names to filter values
      Returns:
      total number of roles matching the given filters
      Throws:
      DAOException - if any.
    • getRoles

      List<Role> getRoles(int first, int pageSize, String sortField, boolean descending, Map<String,String> filters) throws DAOException
      getRoles.
      Parameters:
      first - index of first result (pagination)
      pageSize - max number of results to return
      sortField - field to sort by
      descending - true for descending sort order
      filters - map of field names to filter values
      Returns:
      list of roles matching the given criteria
      Throws:
      DAOException - if any.
    • getRole

      Role getRole(long id) throws DAOException
      getRole.
      Parameters:
      id - database primary key of the role
      Returns:
      the matching role, or null if not found
      Throws:
      DAOException - if any.
    • getRole

      Role getRole(String name) throws DAOException
      getRole.
      Parameters:
      name - name of the role to look up
      Returns:
      the matching role, or null if not found
      Throws:
      DAOException - if any.
    • addRole

      boolean addRole(Role role) throws DAOException
      addRole.
      Parameters:
      role - role to persist
      Returns:
      true if role was added successfully; false otherwise
      Throws:
      DAOException - if any.
    • updateRole

      boolean updateRole(Role role) throws DAOException
      updateRole.
      Parameters:
      role - role to update in the database
      Returns:
      true if role was updated successfully; false otherwise
      Throws:
      DAOException - if any.
    • deleteRole

      boolean deleteRole(Role role) throws DAOException
      deleteRole.
      Parameters:
      role - role to delete from the database
      Returns:
      true if role was deleted successfully; false otherwise
      Throws:
      DAOException - if any.
    • getAllUserRoles

      List<UserRole> getAllUserRoles() throws DAOException
      getAllUserRoles.
      Returns:
      list of all user role assignments in the database
      Throws:
      DAOException - if any.
    • getUserRoleCount

      long getUserRoleCount(UserGroup userGroup, User user, Role role) throws DAOException
      getUserRoleCount.
      Parameters:
      userGroup - user group to filter by, or null to ignore
      user - user to filter by, or null to ignore
      role - role to filter by, or null to ignore
      Returns:
      Row count
      Throws:
      DAOException - if any.
    • getUserRoles

      List<UserRole> getUserRoles(UserGroup userGroup, User user, Role role) throws DAOException
      getUserRoles.
      Parameters:
      userGroup - user group to filter by, or null to ignore
      user - user to filter by, or null to ignore
      role - role to filter by, or null to ignore
      Returns:
      list of user role assignments matching the given filters
      Throws:
      DAOException - if any.
    • addUserRole

      boolean addUserRole(UserRole userRole) throws DAOException
      addUserRole.
      Parameters:
      userRole - user role assignment to persist
      Returns:
      true if user role was added successfully; false otherwise
      Throws:
      DAOException - if any.
    • updateUserRole

      boolean updateUserRole(UserRole userRole) throws DAOException
      updateUserRole.
      Parameters:
      userRole - user role assignment to update in the database
      Returns:
      true if user role was updated successfully; false otherwise
      Throws:
      DAOException - if any.
    • deleteUserRole

      boolean deleteUserRole(UserRole userRole) throws DAOException
      deleteUserRole.
      Parameters:
      userRole - user role assignment to delete from the database
      Returns:
      true if user role was deleted successfully; false otherwise
      Throws:
      DAOException - if any.
    • getAllLicenseTypes

      List<LicenseType> getAllLicenseTypes() throws DAOException
      getAllLicenseTypes.
      Returns:
      list of all license types in the database
      Throws:
      DAOException - if any.
    • getLicenseTypeCount

      long getLicenseTypeCount(Map<String,String> filters) throws DAOException
      getLicenseTypeCount.
      Parameters:
      filters - map of field names to filter values
      Returns:
      total number of license types matching the given filters
      Throws:
      DAOException - if any.
    • getCoreLicenseTypeCount

      long getCoreLicenseTypeCount(Map<String,String> filters) throws DAOException
      getCoreLicenseTypeCount.
      Parameters:
      filters - map of field names to filter values
      Returns:
      total number of core license types matching the given filters
      Throws:
      DAOException - if any.
    • getRecordLicenseTypes

      List<LicenseType> getRecordLicenseTypes() throws DAOException
      getRecordLicenseTypes.
      Returns:
      list of license types that apply at the record level
      Throws:
      DAOException - if any.
    • getLicenseTypes

      List<LicenseType> getLicenseTypes(int first, int pageSize, String sortField, boolean descending, Map<String,String> filters) throws DAOException
      getLicenseTypes.
      Parameters:
      first - index of first result (pagination)
      pageSize - max number of results to return
      sortField - field to sort by
      descending - true for descending sort order
      filters - map of field names to filter values
      Returns:
      list of license types matching the given criteria
      Throws:
      DAOException - if any.
    • getCoreLicenseTypes

      List<LicenseType> getCoreLicenseTypes(int first, int pageSize, String sortField, boolean descending, Map<String,String> filters) throws DAOException
      getCoreLicenseTypes.
      Parameters:
      first - index of first result (pagination)
      pageSize - max number of results to return
      sortField - field to sort by
      descending - true for descending sort order
      filters - map of field names to filter values
      Returns:
      list of core license types matching the given criteria
      Throws:
      DAOException - if any.
    • getLicenseType

      LicenseType getLicenseType(long id) throws DAOException
      getLicenseType.
      Parameters:
      id - database primary key of the license type
      Returns:
      the matching license type, or null if not found
      Throws:
      DAOException - if any.
    • getLicenseType

      LicenseType getLicenseType(String name) throws DAOException
      getLicenseType.
      Parameters:
      name - name of the license type to look up
      Returns:
      the matching license type, or null if not found
      Throws:
      DAOException - if any.
    • getLicenseTypes

      List<LicenseType> getLicenseTypes(List<String> names) throws DAOException
      Returns all license types that match the given name list.
      Parameters:
      names - list of license type names to look up
      Returns:
      list of license types whose names are contained in the given list
      Throws:
      DAOException - in case of errors
    • getOverridingLicenseType

      List<LicenseType> getOverridingLicenseType(LicenseType licenseType) throws DAOException
      Parameters:
      licenseType - license type whose overriding types to retrieve
      Returns:
      List of license types overriding given licenseType
      Throws:
      DAOException
    • addLicenseType

      boolean addLicenseType(LicenseType licenseType) throws DAOException
      addLicenseType.
      Parameters:
      licenseType - license type to persist
      Returns:
      true if license type was added successfully; false otherwise
      Throws:
      DAOException - if any.
    • updateLicenseType

      boolean updateLicenseType(LicenseType licenseType) throws DAOException
      updateLicenseType.
      Parameters:
      licenseType - license type to update in the database
      Returns:
      true if license type was updated successfully; false otherwise
      Throws:
      DAOException - if any.
    • deleteLicenseType

      boolean deleteLicenseType(LicenseType licenseType) throws DAOException
      deleteLicenseType.
      Parameters:
      licenseType - license type to delete from the database
      Returns:
      true if license type was deleted successfully; false otherwise
      Throws:
      DAOException - if any.
    • getAllLicenses

      List<License> getAllLicenses() throws DAOException
      getAllLicenses.
      Returns:
      list of all licenses in the database
      Throws:
      DAOException - if any.
    • getLicense

      License getLicense(Long id) throws DAOException
      getLicense.
      Parameters:
      id - database primary key of the license
      Returns:
      the matching license, or null if not found
      Throws:
      DAOException - if any.
    • getLicenses

      List<License> getLicenses(LicenseType licenseType) throws DAOException
      Parameters:
      licenseType - license type to filter by
      Returns:
      List of Licenses of the given licenseType
      Throws:
      DAOException
    • getLicenses

      List<License> getLicenses(ILicensee licensee) throws DAOException
      Parameters:
      licensee - licensee (user, group, or IP range) to filter by
      Returns:
      List of Licenses for the given licensee
      Throws:
      DAOException
    • getLicenseCount

      long getLicenseCount(LicenseType licenseType) throws DAOException
      Returns the number of licenses that use the given license type.
      Parameters:
      licenseType - license type to count licenses for
      Returns:
      Number of existing Licenses of the given licenseType
      Throws:
      DAOException
    • addLicense

      boolean addLicense(License license) throws DAOException
      addLicenseType.
      Parameters:
      license - license to persist
      Returns:
      true if license was added successfully; false otherwise
      Throws:
      DAOException - if any.
    • updateLicense

      boolean updateLicense(License license) throws DAOException
      updateLicenseType.
      Parameters:
      license - license to update in the database
      Returns:
      true if license was updated successfully; false otherwise
      Throws:
      DAOException - if any.
    • deleteLicense

      boolean deleteLicense(License license) throws DAOException
      deleteLicenseType.
      Parameters:
      license - license to delete from the database
      Returns:
      true if license was deleted successfully; false otherwise
      Throws:
      DAOException - if any.
    • getTicket

      AccessTicket getTicket(Long id) throws DAOException
      Parameters:
      id - database id of the access ticket
      Returns:
      AccessTicket with the given id
      Throws:
      DAOException
    • getTicketByPasswordHash

      AccessTicket getTicketByPasswordHash(String passwordHash) throws DAOException
      Parameters:
      passwordHash - password hash of the access ticket
      Returns:
      AccessTicket with the given passwordHash
      Throws:
      DAOException
    • getActiveTicketCount

      long getActiveTicketCount(Map<String,String> filters) throws DAOException
      getActiveTicketCount.
      Parameters:
      filters - Selected filters
      Returns:
      Number of found rows
      Throws:
      DAOException - if any.
    • getActiveTickets

      List<AccessTicket> getActiveTickets(int first, int pageSize, String sortField, boolean descending, Map<String,String> filters) throws DAOException
      getActiveRecordAccessTickets.
      Parameters:
      first - First row index
      pageSize - Number of rows
      sortField - field to sort by
      descending - true if descending order requested; false otherwise
      filters - Selected filters
      Returns:
      list of active access tickets matching the given criteria
      Throws:
      DAOException - if any.
    • getTicketRequests

      List<AccessTicket> getTicketRequests() throws DAOException
      Returns:
      AccessTickets with the requested status
      Throws:
      DAOException
    • addTicket

      boolean addTicket(AccessTicket ticket) throws DAOException
      addTicket.
      Parameters:
      ticket - access ticket to persist
      Returns:
      true if ticket was added successfully; false otherwise
      Throws:
      DAOException - if any.
    • updateTicket

      boolean updateTicket(AccessTicket ticket) throws DAOException
      updateTicket.
      Parameters:
      ticket - access ticket to update in the database
      Returns:
      true if ticket was updated successfully; false otherwise
      Throws:
      DAOException - if any.
    • deleteTicket

      boolean deleteTicket(AccessTicket ticket) throws DAOException
      deleteTicket.
      Parameters:
      ticket - access ticket to delete from the database
      Returns:
      true if ticket was deleted successfully; false otherwise
      Throws:
      DAOException - if any.
    • getAllIpRanges

      List<IpRange> getAllIpRanges() throws DAOException
      getAllIpRanges.
      Returns:
      list of all IP ranges in the database
      Throws:
      DAOException - if any.
    • getIpRangeCount

      long getIpRangeCount(Map<String,String> filters) throws DAOException
      getIpRangeCount.
      Parameters:
      filters - map of field names to filter values
      Returns:
      total number of IP ranges matching the given filters
      Throws:
      DAOException - if any.
    • getIpRanges

      List<IpRange> getIpRanges(int first, int pageSize, String sortField, boolean descending, Map<String,String> filters) throws DAOException
      getIpRanges.
      Parameters:
      first - index of first result (pagination)
      pageSize - max number of results to return
      sortField - field to sort by
      descending - true for descending sort order
      filters - map of field names to filter values
      Returns:
      list of IP ranges matching the given criteria
      Throws:
      DAOException - if any.
    • getIpRange

      IpRange getIpRange(long id) throws DAOException
      getIpRange.
      Parameters:
      id - database primary key of the IP range
      Returns:
      the matching IP range, or null if not found
      Throws:
      DAOException - if any.
    • getIpRange

      IpRange getIpRange(String name) throws DAOException
      getIpRange.
      Parameters:
      name - name of the IP range to look up
      Returns:
      the matching IP range, or null if not found
      Throws:
      DAOException - if any.
    • addIpRange

      boolean addIpRange(IpRange ipRange) throws DAOException
      addIpRange.
      Parameters:
      ipRange - IP range to persist
      Returns:
      true if IP range was added successfully; false otherwise
      Throws:
      DAOException - if any.
    • updateIpRange

      boolean updateIpRange(IpRange ipRange) throws DAOException
      updateIpRange.
      Parameters:
      ipRange - IP range to update in the database
      Returns:
      true if IP range was updated successfully; false otherwise
      Throws:
      DAOException - if any.
    • deleteIpRange

      boolean deleteIpRange(IpRange ipRange) throws DAOException
      deleteIpRange.
      Parameters:
      ipRange - IP range to delete from the database
      Returns:
      true if IP range was deleted successfully; false otherwise
      Throws:
      DAOException - if any.
    • getAllCommentGroups

      List<CommentGroup> getAllCommentGroups() throws DAOException
      Returns:
      All existing CommentGroups
      Throws:
      DAOException
    • getCommentGroupUnfiltered

      CommentGroup getCommentGroupUnfiltered() throws DAOException
      Returns:
      CommentGroup
      Throws:
      DAOException
    • getCommentGroup

      CommentGroup getCommentGroup(long id) throws DAOException
      getCommentGroup.
      Parameters:
      id - database primary key of the comment group
      Returns:
      the matching comment group, or null if not found
      Throws:
      DAOException - if any.
    • addCommentGroup

      boolean addCommentGroup(CommentGroup commentGroup) throws DAOException
      addCommentGroup.
      Parameters:
      commentGroup - comment group to persist
      Returns:
      true if comment group was added successfully; false otherwise
      Throws:
      DAOException - if any.
    • updateCommentGroup

      boolean updateCommentGroup(CommentGroup commentGroup) throws DAOException
      updateCommentGroup.
      Parameters:
      commentGroup - comment group to update in the database
      Returns:
      true if comment group was updated successfully; false otherwise
      Throws:
      DAOException - if any.
    • deleteCommentGroup

      boolean deleteCommentGroup(CommentGroup commentGroup) throws DAOException
      deleteCommentGroup.
      Parameters:
      commentGroup - comment group to delete from the database
      Returns:
      true if comment group was deleted successfully; false otherwise
      Throws:
      DAOException - if any.
    • getAllComments

      List<Comment> getAllComments() throws DAOException
      getAllComments.
      Returns:
      list of all comments in the database
      Throws:
      DAOException - if any.
    • getCommentCount

      long getCommentCount(Map<String,String> filters, User owner, Set<String> targetPIs) throws DAOException
      getCommentCount.
      Parameters:
      filters - map of field names to filter values
      owner - user who owns the comments, or null for all users
      targetPIs - set of persistent identifiers to restrict results to
      Returns:
      Number of rows that match the criteria
      Throws:
      DAOException - if any.
    • getComments

      List<Comment> getComments(int first, int pageSize, String sortField, boolean descending, Map<String,String> filters, Set<String> targetPIs) throws DAOException
      getComments.
      Parameters:
      first - index of first result (pagination)
      pageSize - max number of results to return
      sortField - field to sort by
      descending - true for descending sort order
      filters - map of field names to filter values
      targetPIs - set of persistent identifiers to restrict results to
      Returns:
      list of comments matching the given criteria
      Throws:
      DAOException - if any.
    • getCommentsOfUser

      List<Comment> getCommentsOfUser(User user, int maxResults, String sortField, boolean descending) throws DAOException
      Gets Comments created by a specific user.
      Parameters:
      user - the creator/owner of the comment
      maxResults - maximum number of results to return
      sortField - class field to sort results by
      descending - set to "true" to sort descending
      Returns:
      A list of at most maxResults comments.
      Throws:
      DAOException
    • getCommentsForPage

      List<Comment> getCommentsForPage(String pi, int page) throws DAOException
      getCommentsForPage.
      Parameters:
      pi - persistent identifier of the record
      page - page order number within the record
      Returns:
      list of comments for the given record page
      Throws:
      DAOException - if any.
    • getCommentsForWork

      List<Comment> getCommentsForWork(String pi) throws DAOException
      getCommentsForWork.
      Parameters:
      pi - persistent identifier of the record
      Returns:
      list of all comments for the given record
      Throws:
      DAOException - if any.
    • countCommentsForWork

      long countCommentsForWork(String pi) throws DAOException
      countCommentsForWork.
      Parameters:
      pi - persistent identifier of the record
      Returns:
      the total number of comments for the record with the given persistent identifier
      Throws:
      DAOException - if any.
    • getComment

      Comment getComment(long id) throws DAOException
      getComment.
      Parameters:
      id - database primary key of the comment
      Returns:
      the matching comment, or null if not found
      Throws:
      DAOException - if any.
    • addComment

      boolean addComment(Comment comment) throws DAOException
      addComment.
      Parameters:
      comment - comment to persist
      Returns:
      true if comment was added successfully; false otherwise
      Throws:
      DAOException - if any.
    • updateComment

      boolean updateComment(Comment comment) throws DAOException
      updateComment.
      Parameters:
      comment - comment to update in the database
      Returns:
      true if comment was updated successfully; false otherwise
      Throws:
      DAOException - if any.
    • deleteComment

      boolean deleteComment(Comment comment) throws DAOException
      deleteComment.
      Parameters:
      comment - comment to delete from the database
      Returns:
      true if comment was deleted successfully; false otherwise
      Throws:
      DAOException - if any.
    • deleteComments

      int deleteComments(String pi, User owner) throws DAOException
      Parameters:
      pi - Record identifier
      owner - Comment creator
      Returns:
      Number of affected rows
      Throws:
      DAOException - if any.
    • changeCommentsOwner

      int changeCommentsOwner(User fromUser, User toUser) throws DAOException
      Changes ownership of all comments from fromUser to toUser.
      Parameters:
      fromUser - user whose comments are to be reassigned
      toUser - user to reassign the comments to
      Returns:
      Number of updated Comments
      Throws:
      DAOException - if any.
    • getAllSearches

      List<Search> getAllSearches() throws DAOException
      getAllSearches.
      Returns:
      list of all saved searches in the database
      Throws:
      DAOException - if any.
    • getSearchCount

      long getSearchCount(User owner, Map<String,String> filters) throws DAOException
      getSearchCount.
      Parameters:
      owner - user who owns the searches, or null for all users
      filters - map of field names to filter values
      Returns:
      total number of saved searches matching the given criteria
      Throws:
      DAOException - if any.
    • getSearches

      List<Search> getSearches(User owner, int first, int pageSize, String sortField, boolean descending, Map<String,String> filters) throws DAOException
      getSearches.
      Parameters:
      owner - user who owns the searches, or null for all users
      first - index of first result (pagination)
      pageSize - max number of results to return
      sortField - field to sort by
      descending - true for descending sort order
      filters - map of field names to filter values
      Returns:
      list of saved searches matching the given criteria
      Throws:
      DAOException - if any.
    • getSearches

      List<Search> getSearches(User owner) throws DAOException
      getSearches.
      Parameters:
      owner - user whose saved searches to retrieve
      Returns:
      list of saved searches owned by the given user
      Throws:
      DAOException - if any.
    • getSearch

      Search getSearch(long id) throws DAOException
      getSearch.
      Parameters:
      id - database primary key of the search
      Returns:
      the matching saved search, or null if not found
      Throws:
      DAOException - if any.
    • addSearch

      boolean addSearch(Search search) throws DAOException
      addSearch.
      Parameters:
      search - saved search to persist
      Returns:
      true if search was added successfully; false otherwise
      Throws:
      DAOException - if any.
    • updateSearch

      boolean updateSearch(Search search) throws DAOException
      updateSearch.
      Parameters:
      search - saved search to update in the database
      Returns:
      true if search was updated successfully; false otherwise
      Throws:
      DAOException - if any.
    • deleteSearch

      boolean deleteSearch(Search search) throws DAOException
      deleteSearch.
      Parameters:
      search - saved search to delete from the database
      Returns:
      true if search was deleted successfully; false otherwise
      Throws:
      DAOException - if any.
    • getUploadJobsWithStatus

      List<UploadJob> getUploadJobsWithStatus(JobStatus status) throws DAOException
      Parameters:
      status - JobStatus
      Returns:
      List of UploadJobs with given status
      Throws:
      DAOException
    • getUploadJobsForCreatorId

      List<UploadJob> getUploadJobsForCreatorId(Long creatorId) throws DAOException
      Parameters:
      creatorId - User id of the creator
      Returns:
      UploadJobs belonging to user with given ID
      Throws:
      DAOException - if any.
    • addUploadJob

      boolean addUploadJob(UploadJob uploadJob) throws DAOException
      addDownloadJob.
      Parameters:
      uploadJob - upload job to persist
      Returns:
      true if upload job was added successfully; false otherwise
      Throws:
      DAOException - if any.
    • updateUploadJob

      boolean updateUploadJob(UploadJob uploadJob) throws DAOException
      updateDownloadJob.
      Parameters:
      uploadJob - upload job to update in the database
      Returns:
      true if upload job was updated successfully; false otherwise
      Throws:
      DAOException - if any.
    • deleteUploadJob

      boolean deleteUploadJob(UploadJob uploadJob) throws DAOException
      deleteDownloadJob.
      Parameters:
      uploadJob - upload job to delete from the database
      Returns:
      true if upload job was deleted successfully; false otherwise
      Throws:
      DAOException - if any.
    • getAllCMSPages

      List<CMSPage> getAllCMSPages() throws DAOException
      getAllCMSPages.
      Returns:
      list of all CMS pages in the database
      Throws:
      DAOException - if any.
    • getCmsPageForStaticPage

      CMSPage getCmsPageForStaticPage(String pageName) throws DAOException
      getCmsPageForStaticPage.
      Parameters:
      pageName - static page name identifying the CMS page
      Returns:
      the CMS page associated with the given static page name, or null if not found
      Throws:
      DAOException - if any.
    • getCMSPageCount

      long getCMSPageCount(Map<String,String> filters, List<Long> allowedTemplates, List<String> allowedSubthemes, List<String> allowedCategories) throws DAOException
      getCMSPageCount.
      Parameters:
      filters - map of field names to filter values
      allowedTemplates - list of template IDs the user is allowed to see
      allowedSubthemes - list of subtheme identifiers the user is allowed to see
      allowedCategories - list of category names the user is allowed to see
      Returns:
      total number of CMS pages matching the given filters and permissions
      Throws:
      DAOException - if any.
    • getCMSPageCountByPropertyValue

      long getCMSPageCountByPropertyValue(String propertyName, String propertyValue) throws DAOException
      Parameters:
      propertyName - name of the CMS page property to filter by
      propertyValue - value of the CMS page property to filter by
      Returns:
      long
      Throws:
      DAOException - if a database error occurs
    • getCMSPagesByPropertyValue

      List<CMSPage> getCMSPagesByPropertyValue(String propertyName, String propertyValue) throws DAOException
      Parameters:
      propertyName - name of the CMS page property to filter by
      propertyValue - value of the CMS page property to filter by
      Returns:
      List
      Throws:
      DAOException - if a database error occurs
    • getCMSPages

      List<CMSPage> getCMSPages(int first, int pageSize, String sortField, boolean descending, Map<String,String> filters, List<Long> allowedTemplates, List<String> allowedSubthemes, List<String> allowedCategories) throws DAOException
      getCMSPages.
      Parameters:
      first - index of first result (pagination)
      pageSize - max number of results to return
      sortField - field to sort by
      descending - true for descending sort order
      filters - map of field names to filter values
      allowedTemplates - list of template IDs the user is allowed to see
      allowedSubthemes - list of subtheme identifiers the user is allowed to see
      allowedCategories - list of category names the user is allowed to see
      Returns:
      list of CMS pages matching the given filters and permissions
      Throws:
      DAOException - if any.
    • getCMSPagesByCategory

      List<CMSPage> getCMSPagesByCategory(CMSCategory category) throws DAOException
      getCMSPagesByCategory.
      Parameters:
      category - category to filter CMS pages by
      Returns:
      list of CMS pages that have the given category assigned
      Throws:
      DAOException - if any.
    • getCMSPagesForRecord

      List<CMSPage> getCMSPagesForRecord(String pi, CMSCategory category) throws DAOException
      getCMSPagesForRecord.
      Parameters:
      pi - persistent identifier of the record
      category - category to filter CMS pages by, or null for all categories
      Returns:
      list of CMS pages associated with the given record
      Throws:
      DAOException - if any.
    • getCMSPagesWithRelatedPi

      List<CMSPage> getCMSPagesWithRelatedPi(int first, int pageSize, LocalDateTime fromDate, LocalDateTime toDate) throws DAOException
      getCMSPagesWithRelatedPi.
      Parameters:
      first - index of first result (pagination)
      pageSize - max number of results to return
      fromDate - lower bound of the date range filter, or null
      toDate - upper bound of the date range filter, or null
      Returns:
      list of CMS pages that have a related persistent identifier within the given date range
      Throws:
      DAOException - if any.
    • isCMSPagesForRecordHaveUpdates

      boolean isCMSPagesForRecordHaveUpdates(String pi, CMSCategory category, LocalDateTime fromDate, LocalDateTime toDate) throws DAOException
      isCMSPagesForRecordHaveUpdates.
      Parameters:
      pi - persistent identifier of the record
      category - category to filter CMS pages by, or null for all categories
      fromDate - lower bound of the date range filter, or null
      toDate - upper bound of the date range filter, or null
      Returns:
      true if any CMS pages for the record have been updated within the given date range; false otherwise
      Throws:
      DAOException - if any.
    • getCMSPageWithRelatedPiCount

      long getCMSPageWithRelatedPiCount(LocalDateTime fromDate, LocalDateTime toDate) throws DAOException
      getCMSPageWithRelatedPiCount.
      Parameters:
      fromDate - lower bound of the date range filter, or null
      toDate - upper bound of the date range filter, or null
      Returns:
      total number of CMS pages with a related persistent identifier within the given date range
      Throws:
      DAOException - if any.
    • getCMSPageDefaultViewForRecord

      CMSPage getCMSPageDefaultViewForRecord(String pi) throws DAOException
      Parameters:
      pi - Record identifier
      Returns:
      CMSPage
      Throws:
      DAOException
    • getCMSPageAccessConditions

      List<String> getCMSPageAccessConditions() throws DAOException
      Returns:
      List
      Throws:
      DAOException
    • getCMSPage

      CMSPage getCMSPage(long id) throws DAOException
      getCMSPage.
      Parameters:
      id - database primary key of the CMS page
      Returns:
      the matching CMS page, or null if not found
      Throws:
      DAOException - if any.
    • addCMSPage

      boolean addCMSPage(CMSPage page) throws DAOException
      addCMSPage.
      Parameters:
      page - CMS page to persist
      Returns:
      true if CMS page was added successfully; false otherwise
      Throws:
      DAOException - if any.
    • updateCMSPage

      boolean updateCMSPage(CMSPage page) throws DAOException
      updateCMSPage.
      Parameters:
      page - CMS page to update in the database
      Returns:
      true if CMS page was updated successfully; false otherwise
      Throws:
      DAOException - if any.
    • deleteCMSPage

      boolean deleteCMSPage(CMSPage page) throws DAOException
      deleteCMSPage.
      Parameters:
      page - CMS page to delete from the database
      Returns:
      true if CMS page was deleted successfully; false otherwise
      Throws:
      DAOException - if any.
    • getAllCMSPageTemplates

      List<CMSPageTemplate> getAllCMSPageTemplates() throws DAOException
      Throws:
      DAOException
    • getCMSPageTemplate

      CMSPageTemplate getCMSPageTemplate(Long id) throws DAOException
      Throws:
      DAOException
    • addCMSPageTemplate

      boolean addCMSPageTemplate(CMSPageTemplate template) throws DAOException
      Throws:
      DAOException
    • updateCMSPageTemplate

      boolean updateCMSPageTemplate(CMSPageTemplate template) throws DAOException
      Throws:
      DAOException
    • removeCMSPageTemplate

      boolean removeCMSPageTemplate(CMSPageTemplate template) throws DAOException
      Throws:
      DAOException
    • getAllCMSMediaItems

      List<CMSMediaItem> getAllCMSMediaItems() throws DAOException
      getAllCMSMediaItems.
      Returns:
      list of all CMS media items in the database
      Throws:
      DAOException - if any.
    • getAllCMSCollectionItems

      List<CMSMediaItem> getAllCMSCollectionItems() throws DAOException
      getAllCMSCollectionItems.
      Returns:
      list of all CMS media items that represent collections
      Throws:
      DAOException - if any.
    • getCMSMediaItem

      CMSMediaItem getCMSMediaItem(long id) throws DAOException
      getCMSMediaItem.
      Parameters:
      id - database primary key of the CMS media item
      Returns:
      the matching CMS media item, or null if not found
      Throws:
      DAOException - if any.
    • getCMSMediaItemByFilename

      CMSMediaItem getCMSMediaItemByFilename(String string) throws DAOException
      getCMSMediaItemByFilename.
      Parameters:
      string - filename of the CMS media item to look up
      Returns:
      the matching CMS media item, or null if not found
      Throws:
      DAOException - if any.
    • addCMSMediaItem

      boolean addCMSMediaItem(CMSMediaItem item) throws DAOException
      addCMSMediaItem.
      Parameters:
      item - CMS media item to persist
      Returns:
      true if CMS media item was added successfully; false otherwise
      Throws:
      DAOException - if any.
    • updateCMSMediaItem

      boolean updateCMSMediaItem(CMSMediaItem item) throws DAOException
      updateCMSMediaItem.
      Parameters:
      item - CMS media item to update in the database
      Returns:
      true if CMS media item was updated successfully; false otherwise
      Throws:
      DAOException - if any.
    • deleteCMSMediaItem

      boolean deleteCMSMediaItem(CMSMediaItem item) throws DAOException
      deleteCMSMediaItem.
      Parameters:
      item - CMS media item to delete from the database
      Returns:
      true if CMS media item was deleted successfully; false otherwise
      Throws:
      DAOException - if any.
    • getCMSMediaItemsByCategory

      List<CMSMediaItem> getCMSMediaItemsByCategory(CMSCategory category) throws DAOException
      Gets a list of all CMSMediaItems which contain the given category.
      Parameters:
      category - category to filter media items by
      Returns:
      all containing cmsPages
      Throws:
      DAOException
    • getAllTopCMSNavigationItems

      List<CMSNavigationItem> getAllTopCMSNavigationItems() throws DAOException
      getAllTopCMSNavigationItems.
      Returns:
      list of all top-level CMS navigation items
      Throws:
      DAOException - if any.
    • getCMSNavigationItem

      CMSNavigationItem getCMSNavigationItem(long id) throws DAOException
      getCMSNavigationItem.
      Parameters:
      id - database primary key of the navigation item
      Returns:
      the matching CMS navigation item, or null if not found
      Throws:
      DAOException - if any.
    • addCMSNavigationItem

      boolean addCMSNavigationItem(CMSNavigationItem item) throws DAOException
      addCMSNavigationItem.
      Parameters:
      item - CMS navigation item to persist
      Returns:
      true if navigation item was added successfully; false otherwise
      Throws:
      DAOException - if any.
    • updateCMSNavigationItem

      boolean updateCMSNavigationItem(CMSNavigationItem item) throws DAOException
      updateCMSNavigationItem.
      Parameters:
      item - CMS navigation item to update in the database
      Returns:
      true if navigation item was updated successfully; false otherwise
      Throws:
      DAOException - if any.
    • deleteCMSNavigationItem

      boolean deleteCMSNavigationItem(CMSNavigationItem item) throws DAOException
      deleteCMSNavigationItem.
      Parameters:
      item - CMS navigation item to delete from the database
      Returns:
      true if navigation item was deleted successfully; false otherwise
      Throws:
      DAOException - if any.
    • getRelatedNavItem

      List<CMSNavigationItem> getRelatedNavItem(CMSPage page) throws DAOException
      getRelatedNavItem.
      Parameters:
      page - CMS page whose related navigation items to retrieve
      Returns:
      list of CMS navigation items linking to the given page
      Throws:
      DAOException - if any.
    • getAllStaticPages

      List<CMSStaticPage> getAllStaticPages() throws DAOException
      getAllStaticPages.
      Returns:
      list of all CMS static page mappings in the database
      Throws:
      DAOException - if any.
    • addStaticPage

      boolean addStaticPage(CMSStaticPage page) throws DAOException
      addStaticPage.
      Parameters:
      page - static page to persist
      Returns:
      true if page added successfully; false otherwise
      Throws:
      DAOException - if any.
    • updateStaticPage

      boolean updateStaticPage(CMSStaticPage page) throws DAOException
      updateStaticPage.
      Parameters:
      page - static page to update in the database
      Returns:
      true if page updated successfully; false otherwise
      Throws:
      DAOException - if any.
    • deleteStaticPage

      boolean deleteStaticPage(CMSStaticPage page) throws DAOException
      deleteStaticPage.
      Parameters:
      page - static page to delete from the database
      Returns:
      true if page deleted successfully; false otherwise
      Throws:
      DAOException - if any.
    • getStaticPageForCMSPage

      List<CMSStaticPage> getStaticPageForCMSPage(CMSPage page) throws DAOException
      getStaticPageForCMSPage.
      Parameters:
      page - CMS page whose static page mappings to retrieve
      Returns:
      list of static page mappings associated with the given CMS page
      Throws:
      DAOException - if any.
    • getStaticPageForTypeType

      Optional<CMSStaticPage> getStaticPageForTypeType(PageType pageType) throws DAOException
      getStaticPageForTypeType.
      Parameters:
      pageType - viewer page type to look up the static page mapping for
      Returns:
      the CMS static page mapped to the given page type, or empty if none exists
      Throws:
      DAOException - if any.
    • getCMSArchiveConfigs

      List<CMSArchiveConfig> getCMSArchiveConfigs(int first, int pageSize, String sortField, boolean descending, Map<String,String> filters) throws DAOException
      getCMSArchiveConfigs.
      Parameters:
      first - index of first result (pagination)
      pageSize - max number of results to return
      sortField - field to sort by
      descending - true for descending sort order
      filters - map of column filter values
      Returns:
      List
      Throws:
      DAOException - if any.
    • getCMSArchiveConfigCount

      long getCMSArchiveConfigCount(Map<String,String> filters) throws DAOException
      getCMSArchiveConfigCount.
      Parameters:
      filters - Selected filters
      Returns:
      Number of found rows
      Throws:
      DAOException - if any.
    • getCmsArchiveConfigForArchive

      Optional<CMSArchiveConfig> getCmsArchiveConfigForArchive(String pi) throws DAOException
      Parameters:
      pi - Archive record identifier
      Returns:
      Optional for the given pi; null if none found
      Throws:
      DAOException
    • saveCMSArchiveConfig

      boolean saveCMSArchiveConfig(CMSArchiveConfig config) throws DAOException
      saveCMSArchiveConfig.
      Parameters:
      config - CMS archive configuration to persist or update
      Returns:
      true if archive config was saved successfully; false otherwise
      Throws:
      DAOException - if any.
    • deleteCMSArchiveConfig

      boolean deleteCMSArchiveConfig(CMSArchiveConfig config) throws DAOException
      deleteCMSArchiveConfig.
      Parameters:
      config - CMS archive configuration to delete from the database
      Returns:
      true if archive config was deleted successfully; false otherwise
      Throws:
      DAOException - if any.
    • getAllCategories

      List<CMSCategory> getAllCategories() throws DAOException
      getAllCategories.
      Returns:
      list of all CMS categories in the database
      Throws:
      DAOException - if any.
    • getCountPagesUsingCategory

      long getCountPagesUsingCategory(CMSCategory category) throws DAOException
      Parameters:
      category - category to count CMS pages for
      Returns:
      Number of existing CMS pages having the given category
      Throws:
      DAOException
    • getCountMediaItemsUsingCategory

      long getCountMediaItemsUsingCategory(CMSCategory category) throws DAOException
      Parameters:
      category - category to count CMS media items for
      Returns:
      Number of existing CMS media items having the given category
      Throws:
      DAOException
    • addCategory

      boolean addCategory(CMSCategory category) throws DAOException
      addCategory.
      Parameters:
      category - CMS category to persist
      Returns:
      true if category added successfully; false otherwise
      Throws:
      DAOException - if any.
    • updateCategory

      boolean updateCategory(CMSCategory category) throws DAOException
      updateCategory.
      Parameters:
      category - CMS category to update in the database
      Returns:
      true if category updated successfully; false otherwise
      Throws:
      DAOException - if any.
    • deleteCategory

      boolean deleteCategory(CMSCategory category) throws DAOException
      deleteCategory.
      Parameters:
      category - CMS category to delete from the database
      Returns:
      true if category deleted successfully; false otherwise
      Throws:
      DAOException - if any.
    • getCategoryByName

      CMSCategory getCategoryByName(String name) throws DAOException
      getCategoryByName.
      Parameters:
      name - name of the category to look up
      Returns:
      the matching CMS category, or null if not found
      Throws:
      DAOException - if any.
    • getCategory

      CMSCategory getCategory(Long id) throws DAOException
      getCategory.
      Parameters:
      id - database primary key of the category
      Returns:
      the matching CMS category, or null if not found
      Throws:
      DAOException - if any.
    • getAllTranskribusJobs

      List<TranskribusJob> getAllTranskribusJobs() throws DAOException
      getAllTranskribusJobs.
      Returns:
      list of all Transkribus jobs in the database
      Throws:
      DAOException - if any.
    • getTranskribusJobs

      List<TranskribusJob> getTranskribusJobs(String pi, String transkribusUserId, JobStatus status) throws DAOException
      getTranskribusJobs.
      Parameters:
      pi - persistent identifier of the record, or null to ignore
      transkribusUserId - Transkribus user ID to filter by, or null to ignore
      status - job status to filter by, or null to ignore
      Returns:
      list of Transkribus jobs matching the given filters
      Throws:
      DAOException - if any.
    • addTranskribusJob

      boolean addTranskribusJob(TranskribusJob job) throws DAOException
      addTranskribusJob.
      Parameters:
      job - Transkribus job to persist
      Returns:
      true if job added successfully; false otherwise
      Throws:
      DAOException - if any.
    • updateTranskribusJob

      boolean updateTranskribusJob(TranskribusJob job) throws DAOException
      updateTranskribusJob.
      Parameters:
      job - Transkribus job to update in the database
      Returns:
      true if job updated successfully; false otherwise
      Throws:
      DAOException - if any.
    • deleteTranskribusJob

      boolean deleteTranskribusJob(TranskribusJob job) throws DAOException
      deleteTranskribusJob.
      Parameters:
      job - Transkribus job to delete from the database
      Returns:
      true if job deleted successfully; false otherwise
      Throws:
      DAOException - if any.
    • getAllCampaigns

      List<Campaign> getAllCampaigns() throws DAOException
      getAllCampaigns.
      Returns:
      list of all crowdsourcing campaigns in the database
      Throws:
      DAOException - if any.
    • getCampaignCount

      long getCampaignCount(Map<String,String> filters) throws DAOException
      getCampaignCount.
      Parameters:
      filters - map of field names to filter values
      Returns:
      total number of crowdsourcing campaigns matching the given filters
      Throws:
      DAOException - if any.
    • getCampaign

      Campaign getCampaign(Long id) throws DAOException
      getCampaign.
      Parameters:
      id - database primary key of the campaign
      Returns:
      the matching campaign, or null if not found
      Throws:
      DAOException - if any.
    • getQuestion

      Question getQuestion(Long id) throws DAOException
      getQuestion.
      Parameters:
      id - database primary key of the question
      Returns:
      the matching campaign question, or null if not found
      Throws:
      DAOException - if any.
    • getCampaigns

      List<Campaign> getCampaigns(int first, int pageSize, String sortField, boolean descending, Map<String,String> filters) throws DAOException
      getCampaigns.
      Parameters:
      first - index of first result (pagination)
      pageSize - max number of results to return
      sortField - field to sort by
      descending - true for descending sort order
      filters - map of field names to filter values
      Returns:
      list of crowdsourcing campaigns matching the given criteria
      Throws:
      DAOException - if any.
    • getCampaignStatisticsForRecord

      List<CampaignRecordStatistic> getCampaignStatisticsForRecord(String pi, CrowdsourcingStatus status) throws DAOException
      getCampaignStatisticsForRecord.
      Parameters:
      pi - persistent identifier of the record
      status - crowdsourcing status to filter by, or null for any status
      Returns:
      list of campaign record statistics for the given record
      Throws:
      DAOException - if any.
    • getCampaignPageStatisticsForRecord

      List<CampaignRecordPageStatistic> getCampaignPageStatisticsForRecord(String pi, CrowdsourcingStatus status) throws DAOException
      getCampaignPageStatisticsForRecord.
      Parameters:
      pi - persistent identifier of the record
      status - crowdsourcing status to filter by, or null for any status
      Returns:
      list of campaign page statistics for the given record
      Throws:
      DAOException - if any.
    • addCampaign

      boolean addCampaign(Campaign campaign) throws DAOException
      addCampaign.
      Parameters:
      campaign - crowdsourcing campaign to persist
      Returns:
      true if campaign added successfully; false otherwise
      Throws:
      DAOException - if any.
    • updateCampaign

      boolean updateCampaign(Campaign campaign) throws DAOException
      updateCampaign.
      Parameters:
      campaign - crowdsourcing campaign to update in the database
      Returns:
      true if campaign updated successfully; false otherwise
      Throws:
      DAOException - if any.
    • deleteCampaign

      boolean deleteCampaign(Campaign campaign) throws DAOException
      deleteCampaign.
      Parameters:
      campaign - crowdsourcing campaign to delete from the database
      Returns:
      true if campaign deleted successfully; false otherwise
      Throws:
      DAOException - if any.
    • deleteCampaignStatisticsForUser

      int deleteCampaignStatisticsForUser(User user) throws DAOException
      Deletes given user from the lists of annotators and reviewers an all campaign statistics.
      Parameters:
      user - user to remove from campaign statistics
      Returns:
      Number of affected campaigns
      Throws:
      DAOException
    • changeCampaignStatisticContributors

      int changeCampaignStatisticContributors(User fromUser, User toUser) throws DAOException
      Replaced fromUser with toUser in the lists of annotators and reviewers an all campaign statistics.
      Parameters:
      fromUser - user to be replaced in campaign statistics
      toUser - user to replace fromUser with
      Returns:
      Number of updated rows
      Throws:
      DAOException
    • checkAvailability

      boolean checkAvailability()
      Returns:
      true if accessible; false otherwise
    • shutdown

      void shutdown()
      shutdown.
    • getPagesWithComments

      List<Integer> getPagesWithComments(String pi) throws DAOException
      getPagesWithComments.
      Parameters:
      pi - persistent identifier of the record
      Returns:
      list of page order numbers that have at least one comment in the given record
      Throws:
      DAOException - if any.
    • getCMSCollections

      List<CMSCollection> getCMSCollections(String solrField) throws DAOException
      getCMSCollections.
      Parameters:
      solrField - Solr field name identifying the collection type
      Returns:
      list of CMS collections for the given Solr field
      Throws:
      DAOException - if any.
    • addCMSCollection

      boolean addCMSCollection(CMSCollection collection) throws DAOException
      addCMSCollection.
      Parameters:
      collection - CMS collection to persist
      Returns:
      true if CMS collection was added successfully; false otherwise
      Throws:
      DAOException - if any.
    • updateCMSCollection

      boolean updateCMSCollection(CMSCollection collection) throws DAOException
      updateCMSCollection.
      Parameters:
      collection - CMS collection to update in the database
      Returns:
      true if CMS collection was updated successfully; false otherwise
      Throws:
      DAOException - if any.
    • deleteCMSCollection

      boolean deleteCMSCollection(CMSCollection collection) throws DAOException
      deleteCMSCollection.
      Parameters:
      collection - CMS collection to delete from the database
      Returns:
      true if CMS collection was deleted successfully; false otherwise
      Throws:
      DAOException - if any.
    • getCMSCollection

      CMSCollection getCMSCollection(String solrField, String solrFieldValue) throws DAOException
      getCMSCollection.
      Parameters:
      solrField - Solr field name identifying the collection type
      solrFieldValue - Solr field value identifying the collection
      Returns:
      the matching CMS collection, or null if not found
      Throws:
      DAOException - if any.
    • getAnnotation

      CrowdsourcingAnnotation getAnnotation(Long id) throws DAOException
      Annotations *.
      Parameters:
      id - database primary key of the annotation
      Returns:
      the matching crowdsourcing annotation, or null if not found
      Throws:
      DAOException - if any.
    • getAnnotationsForCampaign

      List<CrowdsourcingAnnotation> getAnnotationsForCampaign(Campaign campaign) throws DAOException
      getAnnotationsForCampaign.
      Parameters:
      campaign - campaign whose annotations to retrieve
      Returns:
      list of crowdsourcing annotations for the given campaign
      Throws:
      DAOException - if any.
    • getAnnotationsForWork

      List<CrowdsourcingAnnotation> getAnnotationsForWork(String pi) throws DAOException
      getAnnotationsForWork.
      Parameters:
      pi - persistent identifier of the record
      Returns:
      list of crowdsourcing annotations for the given record
      Throws:
      DAOException - if any.
    • getAnnotationCountForWork

      long getAnnotationCountForWork(String pi) throws DAOException
      Parameters:
      pi - persistent identifier of the record
      Returns:
      Number of existing annotations for the given pi
      Throws:
      DAOException
    • getAnnotationsForCampaignAndWork

      List<CrowdsourcingAnnotation> getAnnotationsForCampaignAndWork(Campaign campaign, String pi) throws DAOException
      getAnnotationsForCampaignAndWork.
      Parameters:
      campaign - campaign whose annotations to retrieve
      pi - persistent identifier of the record
      Returns:
      list of crowdsourcing annotations for the given campaign and record
      Throws:
      DAOException - if any.
    • getAnnotationsForTarget

      List<CrowdsourcingAnnotation> getAnnotationsForTarget(String pi, Integer page) throws DAOException
      getAnnotationsForTarget.
      Parameters:
      pi - persistent identifier of the record
      page - page order number within the record, or null for all pages
      Returns:
      list of crowdsourcing annotations targeting the given record page
      Throws:
      DAOException - if any.
    • getAnnotationsForTarget

      List<CrowdsourcingAnnotation> getAnnotationsForTarget(String pi, Integer page, String motivation) throws DAOException
      Throws:
      DAOException
    • getAnnotationsForUserId

      List<CrowdsourcingAnnotation> getAnnotationsForUserId(Long userId, Integer maxResults, String sortField, boolean descending) throws DAOException
      Parameters:
      userId - database id of the annotation creator
      maxResults - maximum number of results to return
      sortField - field to sort by
      descending - true for descending sort order
      Returns:
      List of CrowdsourcingAnnotations for the given userId
      Throws:
      DAOException
    • getAnnotations

      List<CrowdsourcingAnnotation> getAnnotations(int first, int pageSize, String sortField, boolean descending, Map<String,String> filters) throws DAOException
      getAnnotations.
      Parameters:
      first - index of first result (pagination)
      pageSize - max number of results to return
      sortField - field to sort by
      descending - true for descending sort order
      filters - map of field names to filter values
      Returns:
      list of crowdsourcing annotations matching the given criteria
      Throws:
      DAOException - if any.
    • getAnnotationCount

      long getAnnotationCount(Map<String,String> filters) throws DAOException
      getAnnotationCount.
      Parameters:
      filters - map of field names to filter values
      Returns:
      total number of crowdsourcing annotations matching the given filters
      Throws:
      DAOException - if any.
    • getAnnotationCountForTarget

      long getAnnotationCountForTarget(String pi, Integer page) throws DAOException
      getAnnotationCountForTarget.
      Parameters:
      pi - persistent identifier of the record
      page - page order number within the record, or null for all pages
      Returns:
      total number of crowdsourcing annotations for the given record page
      Throws:
      DAOException - if any.
    • getAnnotationsForCampaignAndTarget

      List<CrowdsourcingAnnotation> getAnnotationsForCampaignAndTarget(Campaign campaign, String pi, Integer page) throws DAOException
      getAnnotationsForCampaignAndTarget.
      Parameters:
      campaign - campaign whose annotations to retrieve
      pi - persistent identifier of the record
      page - page order number within the record, or null for all pages
      Returns:
      list of crowdsourcing annotations for the given campaign and record page
      Throws:
      DAOException - if any.
    • addAnnotation

      boolean addAnnotation(CrowdsourcingAnnotation annotation) throws DAOException
      addAnnotation.
      Parameters:
      annotation - crowdsourcing annotation to persist
      Returns:
      true if annotation was added successfully; false otherwise
      Throws:
      DAOException - if any.
    • updateAnnotation

      boolean updateAnnotation(CrowdsourcingAnnotation annotation) throws DAOException
      updateAnnotation.
      Parameters:
      annotation - crowdsourcing annotation to update in the database
      Returns:
      true if annotation was updated successfully; false otherwise
      Throws:
      DAOException - if any.
    • deleteAnnotation

      boolean deleteAnnotation(CrowdsourcingAnnotation annotation) throws DAOException
      deleteAnnotation.
      Parameters:
      annotation - crowdsourcing annotation to delete from the database
      Returns:
      true if annotation was deleted successfully; false otherwise
      Throws:
      DAOException - if any.
    • getGeoMap

      GeoMap getGeoMap(Long mapId) throws DAOException
      Gets the GeoMap of the given mapId.
      Parameters:
      mapId - database id of the geo map
      Returns:
      The GeoMap of the given id or else null
      Throws:
      DAOException - if a database error occurs
    • getAllGeoMaps

      List<GeoMap> getAllGeoMaps() throws DAOException
      Gets all GeoMaps in database.
      Returns:
      A list of all stored GeoMaps
      Throws:
      DAOException
    • addGeoMap

      boolean addGeoMap(GeoMap map) throws DAOException
      Adds the given map to the database if no map of the same id already exists.
      Parameters:
      map - geo map to add
      Returns:
      true if successful
      Throws:
      DAOException
    • updateGeoMap

      boolean updateGeoMap(GeoMap map) throws DAOException
      Updates the given GeoMap in the database.
      Parameters:
      map - geo map to update
      Returns:
      true if successful
      Throws:
      DAOException
    • deleteGeoMap

      boolean deleteGeoMap(GeoMap map) throws DAOException
      Deletes the given GeoMap from the database.
      Parameters:
      map - geo map to delete
      Returns:
      true if successful
      Throws:
      DAOException
    • getPagesUsingMap

      List<CMSPage> getPagesUsingMap(GeoMap map) throws DAOException
      Returns a list of CMS-pages embedding the given map.
      Parameters:
      map - geo map to find embedding pages for
      Returns:
      List of CMSPages that use given map
      Throws:
      DAOException
    • getPagesUsingMapInSidebar

      List<CMSPage> getPagesUsingMapInSidebar(GeoMap map) throws DAOException
      Returns a list of CMS-pages embedding the given map in a sidebar widget.
      Parameters:
      map - geo map to find embedding sidebar pages for
      Returns:
      List of CMSPages that use given map in sidebar
      Throws:
      DAOException
    • getCMSPagesForSubtheme

      List<CMSPage> getCMSPagesForSubtheme(String subtheme) throws DAOException
      Parameters:
      subtheme - subtheme identifier to filter CMS pages by
      Returns:
      List of CMSPages that use given subtheme
      Throws:
      DAOException
    • getRecordNotes

      List<CMSRecordNote> getRecordNotes(int first, int pageSize, String sortField, boolean descending, Map<String,String> filters) throws DAOException
      Gets a paginated list of CMSRecordNotes.
      Parameters:
      first - index of first result (pagination)
      pageSize - max number of results to return
      sortField - field to sort by
      descending - true for descending sort order
      filters - map of column filter values
      Returns:
      List of CMSPages that match the given filters
      Throws:
      DAOException
    • getRecordNotesForPi

      List<CMSSingleRecordNote> getRecordNotesForPi(String pi, boolean displayedNotesOnly) throws DAOException
      Gets all CMSRecordNotes for the given pi.
      Parameters:
      pi - The pi of the record.
      displayedNotesOnly - set to true to only return notes with CMSRecordNote.isDisplayNote() set to true
      Returns:
      List of CMSSingleRecordNotes for the given pi
      Throws:
      DAOException
    • getAllMultiRecordNotes

      List<CMSMultiRecordNote> getAllMultiRecordNotes(boolean displayedNotesOnly) throws DAOException
      Get all CMSMultiRecordNotes. To find notes relating to record, all notes must be check for matching query
      Parameters:
      displayedNotesOnly - if true, only return notes marked as displayed
      Returns:
      List of all existing CMSSingleRecordNotes, optionaly filtered by displayed only
      Throws:
      DAOException
    • getAllRecordNotes

      List<CMSRecordNote> getAllRecordNotes() throws DAOException
      Gets all persisted CMSRecordNotes.
      Returns:
      List of all existing CMSSingleRecordNotes
      Throws:
      DAOException
    • getRecordNote

      CMSRecordNote getRecordNote(Long id) throws DAOException
      Gets a CMSRecordNote by its id property.
      Parameters:
      id - database id of the record note
      Returns:
      CMSSingleRecordNote with the given id
      Throws:
      DAOException - if a database error occurs
    • addRecordNote

      boolean addRecordNote(CMSRecordNote note) throws DAOException
      Persist a new CMSRecordNote.
      Parameters:
      note - record note to add
      Returns:
      true if note added successfully; false otherwise
      Throws:
      DAOException - if a database error occurs
    • updateRecordNote

      boolean updateRecordNote(CMSRecordNote note) throws DAOException
      Updates an existing CMSRecordNote.
      Parameters:
      note - record note to update
      Returns:
      true if note updated successfully; false otherwise
      Throws:
      DAOException - if a database error occurs
    • deleteRecordNote

      boolean deleteRecordNote(CMSRecordNote note) throws DAOException
      Deletes an existing CMSRecordNote.
      Parameters:
      note - record note to delete
      Returns:
      true if note deleted successfully; false otherwise
      Throws:
      DAOException - if a database error occurs
    • saveTermsOfUse

      boolean saveTermsOfUse(TermsOfUse tou) throws DAOException
      Throws:
      DAOException
    • getTermsOfUse

      TermsOfUse getTermsOfUse() throws DAOException
      Throws:
      DAOException
    • resetUserAgreementsToTermsOfUse

      boolean resetUserAgreementsToTermsOfUse() throws DAOException
      Throws:
      DAOException
    • getAllSliders

      List<CMSSlider> getAllSliders() throws DAOException
      Throws:
      DAOException
    • getSlider

      CMSSlider getSlider(Long id) throws DAOException
      Throws:
      DAOException
    • addSlider

      boolean addSlider(CMSSlider slider) throws DAOException
      Throws:
      DAOException
    • updateSlider

      boolean updateSlider(CMSSlider slider) throws DAOException
      Throws:
      DAOException
    • deleteSlider

      boolean deleteSlider(CMSSlider slider) throws DAOException
      Throws:
      DAOException
    • getPagesUsingSlider

      List<CMSPage> getPagesUsingSlider(CMSSlider slider) throws DAOException
      Throws:
      DAOException
    • getConfiguredThemes

      List<ThemeConfiguration> getConfiguredThemes() throws DAOException
      Throws:
      DAOException
    • getTheme

      ThemeConfiguration getTheme(String name) throws DAOException
      Throws:
      DAOException
    • addTheme

      boolean addTheme(ThemeConfiguration theme) throws DAOException
      Throws:
      DAOException
    • updateTheme

      boolean updateTheme(ThemeConfiguration theme) throws DAOException
      Throws:
      DAOException
    • deleteTheme

      boolean deleteTheme(ThemeConfiguration theme) throws DAOException
      Throws:
      DAOException
    • getAnnotations

      List<CrowdsourcingAnnotation> getAnnotations(int first, int pageSize, String sortField, boolean descending, String filterString, Map<String,Object> filterParams) throws DAOException
      Parameters:
      first - index of first result (pagination)
      pageSize - max number of results to return
      sortField - field to sort by
      descending - true for descending sort order
      filterString - JPQL WHERE clause fragment for additional filtering
      filterParams - named parameters for the filterString clause
      Returns:
      List of CrowdsourcingAnnotations matching given filters
      Throws:
      DAOException
    • getAllAnnotationsByMotivation

      List<CrowdsourcingAnnotation> getAllAnnotationsByMotivation(String commenting) throws DAOException
      Parameters:
      commenting - annotation motivation value to filter by
      Returns:
      List of CrowdsourcingAnnotations matching given commenting
      Throws:
      DAOException
    • getAllAnnotations

      List<CrowdsourcingAnnotation> getAllAnnotations(String sortField, boolean sortDescending) throws DAOException
      Parameters:
      sortField - field to sort by
      sortDescending - true for descending sort order
      Returns:
      List of all existing CrowdsourcingAnnotations, optionally sorted by given sortField
      Throws:
      DAOException
    • getTotalAnnotationCount

      long getTotalAnnotationCount() throws DAOException
      Returns:
      Number of all existing CrowdsourcingAnnotations
      Throws:
      DAOException
    • getAllCustomWidgets

      List<CustomSidebarWidget> getAllCustomWidgets() throws DAOException
      Throws:
      DAOException
    • getCustomWidget

      CustomSidebarWidget getCustomWidget(Long id) throws DAOException
      Throws:
      DAOException
    • addCustomWidget

      boolean addCustomWidget(CustomSidebarWidget widget) throws DAOException
      Throws:
      DAOException
    • updateCustomWidget

      boolean updateCustomWidget(CustomSidebarWidget widget) throws DAOException
      Throws:
      DAOException
    • deleteCustomWidget

      boolean deleteCustomWidget(Long id) throws DAOException
      Throws:
      DAOException
    • getPagesUsingWidget

      List<CMSPage> getPagesUsingWidget(CustomSidebarWidget widget) throws DAOException
      Throws:
      DAOException
    • getCookieBanner

      CookieBanner getCookieBanner() throws DAOException
      Throws:
      DAOException
    • saveCookieBanner

      boolean saveCookieBanner(CookieBanner banner) throws DAOException
      Throws:
      DAOException
    • getDisclaimer

      Disclaimer getDisclaimer() throws DAOException
      Get the single stored Disclaimer. May return null if no disclaimer has been persisted yet
      Returns:
      the disclaimer or null
      Throws:
      DAOException
    • saveDisclaimer

      boolean saveDisclaimer(Disclaimer disclaimer) throws DAOException
      Throws:
      DAOException
    • getNumRecordsWithComments

      Long getNumRecordsWithComments(User user) throws DAOException
      Throws:
      DAOException
    • getNativeQueryResults

      List getNativeQueryResults(String query) throws DAOException
      Throws:
      DAOException
    • executeUpdate

      int executeUpdate(String string) throws DAOException
      Throws:
      DAOException
    • getAllClientApplications

      List<ClientApplication> getAllClientApplications() throws DAOException
      Throws:
      DAOException
    • getClientApplication

      ClientApplication getClientApplication(long id) throws DAOException
      Throws:
      DAOException
    • saveClientApplication

      boolean saveClientApplication(ClientApplication client) throws DAOException
      Throws:
      DAOException
    • deleteClientApplication

      boolean deleteClientApplication(long id) throws DAOException
      Throws:
      DAOException
    • getClientApplicationByClientId

      ClientApplication getClientApplicationByClientId(String clientId) throws DAOException
      Throws:
      DAOException
    • getAllUsageStatistics

      List<DailySessionUsageStatistics> getAllUsageStatistics() throws DAOException
      Throws:
      DAOException
    • getUsageStatistics

      DailySessionUsageStatistics getUsageStatistics(LocalDate date) throws DAOException
      Throws:
      DAOException
    • getUsageStatistics

      List<DailySessionUsageStatistics> getUsageStatistics(LocalDate start, LocalDate end) throws DAOException
      Throws:
      DAOException
    • addUsageStatistics

      boolean addUsageStatistics(DailySessionUsageStatistics statistics) throws DAOException
      Throws:
      DAOException
    • updateUsageStatistics

      boolean updateUsageStatistics(DailySessionUsageStatistics statistics) throws DAOException
      Throws:
      DAOException
    • deleteUsageStatistics

      boolean deleteUsageStatistics(long id) throws DAOException
      Throws:
      DAOException
    • deleteCMSComponent

      boolean deleteCMSComponent(PersistentCMSComponent persistentCMSComponent) throws DAOException
      Throws:
      DAOException
    • deleteCMSContent

      boolean deleteCMSContent(CMSContent content) throws DAOException
      Throws:
      DAOException
    • addCMSComponent

      boolean addCMSComponent(PersistentCMSComponent persistentCMSComponent) throws DAOException
      Throws:
      DAOException
    • updatedCMSComponent

      boolean updatedCMSComponent(PersistentCMSComponent persistentCMSComponent) throws DAOException
      Throws:
      DAOException
    • getCMSComponent

      PersistentCMSComponent getCMSComponent(Long id) throws DAOException
      Throws:
      DAOException
    • deleteViewerMessage

      boolean deleteViewerMessage(ViewerMessage message) throws DAOException
      Throws:
      DAOException
    • addViewerMessage

      boolean addViewerMessage(ViewerMessage message) throws DAOException
      Throws:
      DAOException
    • updateViewerMessage

      boolean updateViewerMessage(ViewerMessage message) throws DAOException
      Throws:
      DAOException
    • getViewerMessage

      ViewerMessage getViewerMessage(Long id) throws DAOException
      Throws:
      DAOException
    • getViewerMessageByMessageID

      ViewerMessage getViewerMessageByMessageID(String id) throws DAOException
      Throws:
      DAOException
    • getViewerMessages

      List<ViewerMessage> getViewerMessages(int first, int pageSize, String sortField, boolean descending, Map<String,String> filters) throws DAOException
      getViewerMessages.
      Parameters:
      first - index of first result (pagination)
      pageSize - max number of results to return
      sortField - field to sort by
      descending - true for descending sort order
      filters - map of field names to filter values
      Returns:
      list of viewer messages matching the given criteria
      Throws:
      DAOException - if any.
    • getViewerMessageCount

      long getViewerMessageCount(Map<String,String> filters) throws DAOException
      getViewerMessageCount.
      Parameters:
      filters - map of field names to filter values
      Returns:
      total number of viewer messages matching the given filters
      Throws:
      DAOException - if any.
    • getRecurringTaskTriggers

      List<RecurringTaskTrigger> getRecurringTaskTriggers() throws DAOException
      Throws:
      DAOException
    • getRecurringTaskTrigger

      RecurringTaskTrigger getRecurringTaskTrigger(Long id) throws DAOException
      Throws:
      DAOException
    • getRecurringTaskTriggerForTask

      RecurringTaskTrigger getRecurringTaskTriggerForTask(ITaskType task) throws DAOException
      Throws:
      DAOException
    • addRecurringTaskTrigger

      boolean addRecurringTaskTrigger(RecurringTaskTrigger trigger) throws DAOException
      Throws:
      DAOException
    • updateRecurringTaskTrigger

      boolean updateRecurringTaskTrigger(RecurringTaskTrigger trigger) throws DAOException
      Throws:
      DAOException
    • deleteRecurringTaskTrigger

      boolean deleteRecurringTaskTrigger(Long id) throws DAOException
      Throws:
      DAOException
    • deleteViewerMessagesBefore

      int deleteViewerMessagesBefore(LocalDateTime date) throws DAOException
      Throws:
      DAOException
    • addHighlight

      boolean addHighlight(HighlightData object) throws DAOException
      Throws:
      DAOException
    • updateHighlight

      boolean updateHighlight(HighlightData object) throws DAOException
      Throws:
      DAOException
    • deleteHighlight

      boolean deleteHighlight(Long id) throws DAOException
      Throws:
      DAOException
    • getHighlight

      HighlightData getHighlight(Long id) throws DAOException
      Throws:
      DAOException
    • getAllHighlights

      List<HighlightData> getAllHighlights() throws DAOException
      Throws:
      DAOException
    • getHighlights

      List<HighlightData> getHighlights(int first, int pageSize, String sortField, boolean descending, Map<String,String> filters) throws DAOException
      Throws:
      DAOException
    • getHighlightsForDate

      List<HighlightData> getHighlightsForDate(LocalDateTime date) throws DAOException
      Throws:
      DAOException
    • getPastHighlightsForDate

      List<HighlightData> getPastHighlightsForDate(int first, int pageSize, String sortField, boolean descending, Map<String,String> filters, LocalDateTime date) throws DAOException
      Throws:
      DAOException
    • getFutureHighlightsForDate

      List<HighlightData> getFutureHighlightsForDate(int first, int pageSize, String sortField, boolean descending, Map<String,String> filters, LocalDateTime date) throws DAOException
      Throws:
      DAOException
    • getMaintenanceMode

      MaintenanceMode getMaintenanceMode() throws DAOException
      Returns the only existing instance of MaintenanceMode.
      Returns:
      the singleton MaintenanceMode entity, or null if not yet persisted
      Throws:
      DAOException - if any.
    • updateMaintenanceMode

      boolean updateMaintenanceMode(MaintenanceMode maintenanceMode) throws DAOException
      updateMaintenanceMode.
      Parameters:
      maintenanceMode - maintenance mode entity to update in the database
      Returns:
      true if maintenance mode was updated successfully; false otherwise
      Throws:
      DAOException - if any.
    • getFactory

      EntityManagerFactory getFactory()
      Get the EntityManagerFactory created when initializing the class. Can be used to explicitly create new EntityManagers.
    • getEntityManager

      EntityManager getEntityManager()
      Get an EntityManager for a query or transaction. Must always be followed by close(EntityManager) Method after the query/transaction
      Returns:
      a new EntityManager
    • close

      void close(EntityManager em) throws DAOException
      Either close the given EntityManager or do some other post query/transaction handling for the given EntityManager. Must be called after each query/transaction.
      Parameters:
      em - EntityManager
      Throws:
      DAOException
    • startTransaction

      EntityTransaction startTransaction(EntityManager em)
      Call getTransaction() on the given EntityManager and then begin() on the transaction.
      Parameters:
      em - EntityManager
      Returns:
      the transaction gotten from the entity manager
    • commitTransaction

      void commitTransaction(EntityTransaction et) throws PersistenceException
      Call EntityTransaction.commit() on the given transaction.
      Parameters:
      et - EntityTransaction
      Throws:
      PersistenceException
    • commitTransaction

      void commitTransaction(EntityManager em) throws PersistenceException
      Call EntityTransaction.commit() on the current transaction of the given EntityManager.
      Parameters:
      em - EntityManager
      Throws:
      PersistenceException
    • handleException

      void handleException(EntityTransaction et) throws PersistenceException
      Handling of exceptions occurred during commitTransaction(EntityTransaction). Usually calls EntityTransaction.rollback()
      Parameters:
      et - EntityTransaction
      Throws:
      PersistenceException
    • handleException

      void handleException(EntityManager em)
      Handling of exceptions occurred during commitTransaction(EntityManager) Usually calls EntityTransaction.rollback() on the current transaction of the given EntityManager.
      Parameters:
      em - EntityManager
      Throws:
      PersistenceException