Package io.goobi.viewer.dao
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 Summary
Modifier and TypeMethodDescriptionbooleanaddAnnotation(CrowdsourcingAnnotation annotation) addAnnotation.booleanaddBookmarkList(BookmarkList bookmarkList) addBookmarkList.booleanaddCampaign(Campaign campaign) addCampaign.booleanaddCategory(CMSCategory category) addCategory.booleanaddCMSCollection(CMSCollection collection) addCMSCollection.booleanaddCMSComponent(PersistentCMSComponent persistentCMSComponent) booleanaddCMSMediaItem(CMSMediaItem item) addCMSMediaItem.booleanaddCMSNavigationItem.booleanaddCMSPage(CMSPage page) addCMSPage.booleanaddCMSPageTemplate(CMSPageTemplate template) booleanaddComment(Comment comment) addComment.booleanaddCommentGroup(CommentGroup commentGroup) addCommentGroup.booleanaddCustomWidget(CustomSidebarWidget widget) booleanAdds the given map to the database if no map of the same id already exists.booleanaddHighlight(HighlightData object) booleanaddIpRange(IpRange ipRange) addIpRange.booleanaddLicense(License license) addLicenseType.booleanaddLicenseType(LicenseType licenseType) addLicenseType.booleanaddRecordNote(CMSRecordNote note) Persist a newCMSRecordNote.booleanbooleanaddRole.booleanaddSearch.booleanbooleanaddStaticPage(CMSStaticPage page) addStaticPage.booleanaddTheme(ThemeConfiguration theme) booleanaddTicket(AccessTicket ticket) addTicket.booleanaddTranskribusJob.booleanaddUploadJob(UploadJob uploadJob) addDownloadJob.booleanaddUsageStatistics(DailySessionUsageStatistics statistics) booleanaddUser.booleanaddUserGroup(UserGroup userGroup) addUserGroup.booleanaddUserRole(UserRole userRole) addUserRole.booleanaddViewerMessage(ViewerMessage message) intchangeCampaignStatisticContributors(User fromUser, User toUser) ReplacedfromUserwithtoUserin the lists of annotators and reviewers an all campaign statistics.intchangeCommentsOwner(User fromUser, User toUser) Changes ownership of all comments fromfromUsertotoUser.booleanvoidclose(EntityManager em) Either close the given EntityManager or do some other post query/transaction handling for the given EntityManager.booleancolumnsExists(String tableName, String columnName) columnsExists.voidCallEntityTransaction.commit()on the current transaction of the given EntityManager.voidCallEntityTransaction.commit()on the given transaction.longcountCommentsForWork.booleandeleteAnnotation(CrowdsourcingAnnotation annotation) deleteAnnotation.booleandeleteBookmarkList(BookmarkList bookmarkList) deleteBookmarkList.booleandeleteCampaign(Campaign campaign) deleteCampaign.intDeletes given user from the lists of annotators and reviewers an all campaign statistics.booleandeleteCategory(CMSCategory category) deleteCategory.booleandeleteClientApplication(long id) booleandeleteCMSArchiveConfig.booleandeleteCMSCollection(CMSCollection collection) deleteCMSCollection.booleandeleteCMSComponent(PersistentCMSComponent persistentCMSComponent) booleandeleteCMSContent(CMSContent content) booleandeleteCMSMediaItem.booleandeleteCMSNavigationItem.booleandeleteCMSPage(CMSPage page) deleteCMSPage.booleandeleteComment(Comment comment) deleteComment.booleandeleteCommentGroup(CommentGroup commentGroup) deleteCommentGroup.intdeleteComments(String pi, User owner) booleanbooleandeleteGeoMap(GeoMap map) Deletes the givenGeoMapfrom the database.booleandeleteHighlight(Long id) booleandeleteIpRange(IpRange ipRange) deleteIpRange.booleandeleteLicense(License license) deleteLicenseType.booleandeleteLicenseType(LicenseType licenseType) deleteLicenseType.booleanDeletes an existingCMSRecordNote.booleanbooleandeleteRole(Role role) deleteRole.booleandeleteSearch(Search search) deleteSearch.booleandeleteSlider(CMSSlider slider) booleandeleteStaticPage.booleandeleteTheme(ThemeConfiguration theme) booleandeleteTicket(AccessTicket ticket) deleteTicket.booleandeleteTranskribusJob.booleandeleteUploadJob(UploadJob uploadJob) deleteDownloadJob.booleandeleteUsageStatistics(long id) booleandeleteUser(User user) deleteUser.booleandeleteUserGroup(UserGroup userGroup) deleteUserGroup.booleandeleteUserRole(UserRole userRole) deleteUserRole.booleandeleteViewerMessage(ViewerMessage message) intintexecuteUpdate(String string) longgetActiveTicketCount(Map<String, String> filters) getActiveTicketCount.getActiveTickets(int first, int pageSize, String sortField, boolean descending, Map<String, String> filters) getActiveRecordAccessTickets.getAllAnnotations(String sortField, boolean sortDescending) getAllAnnotationsByMotivation(String commenting) getAllBookmarkLists.getAllCampaigns.getAllCategories.getAllCMSCollectionItems.getAllCMSMediaItems.getAllCMSPages.getAllComments.Gets allGeoMaps in database.getAllIpRanges.getAllLicenses.getAllLicenseTypes.getAllMultiRecordNotes(boolean displayedNotesOnly) Get allCMSMultiRecordNotes.Gets all persistedCMSRecordNotes.getAllRoles.getAllSearches.getAllStaticPages.getAllTopCMSNavigationItems.getAllTranskribusJobs.getAllUserGroups.getAllUserRoles.getAllUsers(boolean refresh) getAllUsers.getAnnotation(Long id) Annotations *.longgetAnnotationCount(Map<String, String> filters) getAnnotationCount.longgetAnnotationCountForTarget(String pi, Integer page) getAnnotationCountForTarget.longgetAnnotations(int first, int pageSize, String sortField, boolean descending, String filterString, Map<String, Object> filterParams) getAnnotations(int first, int pageSize, String sortField, boolean descending, Map<String, String> filters) getAnnotations.getAnnotationsForCampaign(Campaign campaign) getAnnotationsForCampaign.getAnnotationsForCampaignAndTarget(Campaign campaign, String pi, Integer page) getAnnotationsForCampaignAndTarget.getAnnotationsForCampaignAndWork(Campaign campaign, String pi) getAnnotationsForCampaignAndWork.getAnnotationsForTarget(String pi, Integer page) getAnnotationsForTarget.getAnnotationsForTarget(String pi, Integer page, String motivation) getAnnotationsForUserId(Long userId, Integer maxResults, String sortField, boolean descending) getAnnotationsForWork.getBookmarkList(long id) getBookmarkList.getBookmarkList(String name, User user) getBookmarkList.getBookmarkListByShareKey(String shareKey) getBookmarkListByShareKey.longgetBookmarkListCount(User user) Gets number of bookmark lists owned by the given user.getBookmarkLists(User user) getBookmarkLists.getCampaign(Long id) getCampaign.longgetCampaignCount(Map<String, String> filters) getCampaignCount.getCampaignPageStatisticsForRecord.getCampaigns(int first, int pageSize, String sortField, boolean descending, Map<String, String> filters) getCampaigns.getCampaignStatisticsForRecord(String pi, CrowdsourcingStatus status) getCampaignStatisticsForRecord.getCategory(Long id) getCategory.getCategoryByName(String name) getCategoryByName.getClientApplication(long id) getClientApplicationByClientId(String clientId) longgetCMSArchiveConfigCount(Map<String, String> filters) getCMSArchiveConfigCount.getCMSArchiveConfigs(int first, int pageSize, String sortField, boolean descending, Map<String, String> filters) getCMSArchiveConfigs.getCMSCollection(String solrField, String solrFieldValue) getCMSCollection.getCMSCollections(String solrField) getCMSCollections.getCMSComponent(Long id) getCMSMediaItem(long id) getCMSMediaItem.getCMSMediaItemByFilename(String string) getCMSMediaItemByFilename.getCMSMediaItemsByCategory(CMSCategory category) Gets a list of allCMSMediaItems which contain the given category.getCMSNavigationItem(long id) getCMSNavigationItem.getCMSPage(long id) getCMSPage.longgetCMSPageCount(Map<String, String> filters, List<Long> allowedTemplates, List<String> allowedSubthemes, List<String> allowedCategories) getCMSPageCount.longgetCMSPageCountByPropertyValue(String propertyName, String propertyValue) getCmsPageForStaticPage(String pageName) getCmsPageForStaticPage.getCMSPages(int first, int pageSize, String sortField, boolean descending, Map<String, String> filters, List<Long> allowedTemplates, List<String> allowedSubthemes, List<String> allowedCategories) getCMSPages.getCMSPagesByCategory(CMSCategory category) getCMSPagesByCategory.getCMSPagesByPropertyValue(String propertyName, String propertyValue) getCMSPagesForRecord(String pi, CMSCategory category) getCMSPagesForRecord.getCMSPagesForSubtheme(String subtheme) getCMSPagesWithRelatedPi(int first, int pageSize, LocalDateTime fromDate, LocalDateTime toDate) getCMSPagesWithRelatedPi.longgetCMSPageWithRelatedPiCount(LocalDateTime fromDate, LocalDateTime toDate) getCMSPageWithRelatedPiCount.getComment(long id) getComment.longgetCommentCount.getCommentGroup(long id) getCommentGroup.getComments(int first, int pageSize, String sortField, boolean descending, Map<String, String> filters, Set<String> targetPIs) getComments.getCommentsForPage(String pi, int page) getCommentsForPage.getCommentsForWork.getCommentsOfUser(User user, int maxResults, String sortField, boolean descending) Gets Comments created by a specific user.longgetCoreLicenseTypeCount(Map<String, String> filters) getCoreLicenseTypeCount.getCoreLicenseTypes(int first, int pageSize, String sortField, boolean descending, Map<String, String> filters) getCoreLicenseTypes.longgetCountMediaItemsUsingCategory(CMSCategory category) longgetCountPagesUsingCategory(CMSCategory category) getCustomWidget(Long id) Get the single storedDisclaimer.Get an EntityManager for a query or transaction.Get the EntityManagerFactory created when initializing the class.getFutureHighlightsForDate(int first, int pageSize, String sortField, boolean descending, Map<String, String> filters, LocalDateTime date) Gets theGeoMapof the given mapId.getHighlight(Long id) getHighlights(int first, int pageSize, String sortField, boolean descending, Map<String, String> filters) getIpRange(long id) getIpRange.getIpRange(String name) getIpRange.longgetIpRangeCount(Map<String, String> filters) getIpRangeCount.getIpRanges(int first, int pageSize, String sortField, boolean descending, Map<String, String> filters) getIpRanges.getLicense(Long id) getLicense.longgetLicenseCount(LicenseType licenseType) Returns the number of licenses that use the given license type.getLicenses(ILicensee licensee) getLicenses(LicenseType licenseType) getLicenseType(long id) getLicenseType.getLicenseType(String name) getLicenseType.longgetLicenseTypeCount(Map<String, String> filters) getLicenseTypeCount.getLicenseTypes(int first, int pageSize, String sortField, boolean descending, Map<String, String> filters) getLicenseTypes.getLicenseTypes(List<String> names) Returns all license types that match the given name list.Returns the only existing instance of MaintenanceMode.getNativeQueryResults(String query) getOverridingLicenseType(LicenseType licenseType) getPagesUsingMap(GeoMap map) Returns a list of CMS-pages embedding the given map.Returns a list of CMS-pages embedding the given map in a sidebar widget.getPagesUsingSlider(CMSSlider slider) getPagesWithComments.getPastHighlightsForDate(int first, int pageSize, String sortField, boolean descending, Map<String, String> filters, LocalDateTime date) getPublicBookmarkLists.getQuestion(Long id) getQuestion.getRecordLicenseTypes.getRecordNote(Long id) Gets aCMSRecordNoteby its id property.getRecordNotes(int first, int pageSize, String sortField, boolean descending, Map<String, String> filters) Gets a paginated list ofCMSRecordNotes.getRecordNotesForPi(String pi, boolean displayedNotesOnly) Gets allCMSRecordNotes for the given pi.getRelatedNavItem(CMSPage page) getRelatedNavItem.getRole(long id) getRole.getRole.longgetRoleCount(Map<String, String> filters) getRoleCount.getRoles.getSearch(long id) getSearch.longgetSearchCount(User owner, Map<String, String> filters) getSearchCount.getSearches(User owner) getSearches.getSearches(User owner, int first, int pageSize, String sortField, boolean descending, Map<String, String> filters) getSearches.getStaticPageForCMSPage.getStaticPageForTypeType(PageType pageType) getStaticPageForTypeType.getTicketByPasswordHash(String passwordHash) longgetTranskribusJobs(String pi, String transkribusUserId, JobStatus status) getTranskribusJobs.getUploadJobsForCreatorId(Long creatorId) getUploadJobsWithStatus(JobStatus status) getUsageStatistics(LocalDate date) getUsageStatistics(LocalDate start, LocalDate end) getUser(long id) getUser.getUserByEmail(String email) getUserByEmail.getUserByNickname(String nickname) getUserByNickname.getUserByOpenId(String identifier) getUserByOpenId.longgetUserCount(Map<String, String> filters) getUserCount.getUserGroup(long id) getUserGroup.getUserGroup(String name) getUserGroup.longgetUserGroupCount(Map<String, String> filters) getUserGroupCount.getUserGroups(int first, int pageSize, String sortField, boolean descending, Map<String, String> filters) getUserGroups.getUserGroups(User owner) getUserGroups.longgetUserRoleCount(UserGroup userGroup, User user, Role role) getUserRoleCount.getUserRoles(UserGroup userGroup, User user, Role role) getUserRoles.getUsers.getUsersByPropertyValue(String propertyName, String propertyValue) getViewerMessage(Long id) longgetViewerMessageCount(Map<String, String> filters) getViewerMessageCount.getViewerMessages(int first, int pageSize, String sortField, boolean descending, Map<String, String> filters) getViewerMessages.voidHandling of exceptions occurred duringcommitTransaction(EntityManager)Usually callsEntityTransaction.rollback()on the current transaction of the given EntityManager.voidHandling of exceptions occurred duringcommitTransaction(EntityTransaction).booleanisCMSPagesForRecordHaveUpdates(String pi, CMSCategory category, LocalDateTime fromDate, LocalDateTime toDate) isCMSPagesForRecordHaveUpdates.booleanremoveCMSPageTemplate(CMSPageTemplate template) booleanbooleanbooleansaveCMSArchiveConfig(CMSArchiveConfig config) saveCMSArchiveConfig.booleansaveCookieBanner(CookieBanner banner) booleansaveDisclaimer(Disclaimer disclaimer) booleansaveTermsOfUse(TermsOfUse tou) voidshutdown()shutdown.CallgetTransaction()on the given EntityManager and thenbegin()on the transaction.booleantableExists(String tableName) tableExists.booleanupdateAnnotation(CrowdsourcingAnnotation annotation) updateAnnotation.booleanupdateBookmarkList(BookmarkList bookmarkList) updateBookmarkList.booleanupdateCampaign(Campaign campaign) updateCampaign.booleanupdateCategory(CMSCategory category) updateCategory.booleanupdateCMSCollection(CMSCollection collection) updateCMSCollection.booleanupdateCMSMediaItem.booleanupdateCMSNavigationItem.booleanupdateCMSPage(CMSPage page) updateCMSPage.booleanupdateCMSPageTemplate(CMSPageTemplate template) booleanupdateComment(Comment comment) updateComment.booleanupdateCommentGroup(CommentGroup commentGroup) updateCommentGroup.booleanbooleanupdatedCMSComponent(PersistentCMSComponent persistentCMSComponent) booleanupdateGeoMap(GeoMap map) Updates the givenGeoMapin the database.booleanupdateHighlight(HighlightData object) booleanupdateIpRange(IpRange ipRange) updateIpRange.booleanupdateLicense(License license) updateLicenseType.booleanupdateLicenseType(LicenseType licenseType) updateLicenseType.booleanupdateMaintenanceMode(MaintenanceMode maintenanceMode) updateMaintenanceMode.booleanUpdates an existingCMSRecordNote.booleanbooleanupdateRole(Role role) updateRole.booleanupdateSearch(Search search) updateSearch.booleanupdateSlider(CMSSlider slider) booleanupdateStaticPage.booleanupdateTheme(ThemeConfiguration theme) booleanupdateTicket(AccessTicket ticket) updateTicket.booleanupdateTranskribusJob.booleanupdateUploadJob(UploadJob uploadJob) updateDownloadJob.booleanupdateUsageStatistics(DailySessionUsageStatistics statistics) booleanupdateUser(User user) updateUser.booleanupdateUserGroup(UserGroup userGroup) updateUserGroup.booleanupdateUserRole(UserRole userRole) updateUserRole.booleanupdateViewerMessage(ViewerMessage message)
-
Method Details
-
tableExists
tableExists.- Parameters:
tableName- name of the database table to check- Returns:
- true if the table exists; false otherwise
- Throws:
SQLException- if any.DAOException
-
columnsExists
columnsExists.- Parameters:
tableName- name of the database table to checkcolumnName- 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
getAllUsers.- Parameters:
refresh- true to bypass cache and reload from database- Returns:
- list of all users in the database
- Throws:
DAOException- if any.
-
getUserCount
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 DAOExceptiongetUsers.- Parameters:
first- index of first result (pagination)pageSize- max number of results to returnsortField- field to sort bydescending- true for descending sort orderfilters- map of field names to filter values- Returns:
- list of users matching the given criteria
- Throws:
DAOException- if any.
-
getUsersByPropertyValue
- Parameters:
propertyName- name of the user property to filter bypropertyValue- value of the user property to filter by- Returns:
- List if users with matching property name/value pair
- Throws:
DAOException
-
getAdminUsers
- Returns:
- List
where User.superuser == true - Throws:
DAOException
-
getUser
getUser.- Parameters:
id- database primary key of the user- Returns:
- the matching user, or null if not found
- Throws:
DAOException- if any.
-
getUserByEmail
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
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
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
addUser.- Parameters:
user- user to persist- Returns:
- true if user was added successfully; false otherwise
- Throws:
DAOException- if any.
-
updateUser
updateUser.- Parameters:
user- user to update in the database- Returns:
- true if user was updated successfully; false otherwise
- Throws:
DAOException- if any.
-
deleteUser
deleteUser.- Parameters:
user- user to delete from the database- Returns:
- true if user was deleted successfully; false otherwise
- Throws:
DAOException- if any.
-
getAllUserGroups
getAllUserGroups.- Returns:
- list of all user groups in the database
- Throws:
DAOException- if any.
-
getUserGroupCount
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 DAOExceptiongetUserGroups.- Parameters:
first- index of first result (pagination)pageSize- max number of results to returnsortField- field to sort bydescending- true for descending sort orderfilters- map of field names to filter values- Returns:
- list of user groups matching the given criteria
- Throws:
DAOException- if any.
-
getUserGroups
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
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
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
addUserGroup.- Parameters:
userGroup- user group to persist- Returns:
- true if user group was added successfully; false otherwise
- Throws:
DAOException- if any.
-
updateUserGroup
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
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
getAllBookmarkLists.- Returns:
- list of all bookmark lists in the database
- Throws:
DAOException- if any.
-
getPublicBookmarkLists
getPublicBookmarkLists.- Returns:
- list of all publicly visible bookmark lists
- Throws:
DAOException- if any.
-
getBookmarkLists
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
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
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
getBookmarkList.- Parameters:
name- name of the bookmark list to look upuser- owner of the bookmark list- Returns:
- the matching bookmark list, or null if not found
- Throws:
DAOException- if any.
-
addBookmarkList
addBookmarkList.- Parameters:
bookmarkList- bookmark list to persist- Returns:
- true if bookmark list was added successfully; false otherwise
- Throws:
DAOException- if any.
-
updateBookmarkList
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
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
getAllRoles.- Returns:
- list of all roles in the database
- Throws:
DAOException- if any.
-
getRoleCount
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 DAOExceptiongetRoles.- Parameters:
first- index of first result (pagination)pageSize- max number of results to returnsortField- field to sort bydescending- true for descending sort orderfilters- map of field names to filter values- Returns:
- list of roles matching the given criteria
- Throws:
DAOException- if any.
-
getRole
getRole.- Parameters:
id- database primary key of the role- Returns:
- the matching role, or null if not found
- Throws:
DAOException- if any.
-
getRole
getRole.- Parameters:
name- name of the role to look up- Returns:
- the matching role, or null if not found
- Throws:
DAOException- if any.
-
addRole
addRole.- Parameters:
role- role to persist- Returns:
- true if role was added successfully; false otherwise
- Throws:
DAOException- if any.
-
updateRole
updateRole.- Parameters:
role- role to update in the database- Returns:
- true if role was updated successfully; false otherwise
- Throws:
DAOException- if any.
-
deleteRole
deleteRole.- Parameters:
role- role to delete from the database- Returns:
- true if role was deleted successfully; false otherwise
- Throws:
DAOException- if any.
-
getAllUserRoles
getAllUserRoles.- Returns:
- list of all user role assignments in the database
- Throws:
DAOException- if any.
-
getUserRoleCount
getUserRoleCount.- Parameters:
userGroup- user group to filter by, or null to ignoreuser- user to filter by, or null to ignorerole- role to filter by, or null to ignore- Returns:
- Row count
- Throws:
DAOException- if any.
-
getUserRoles
getUserRoles.- Parameters:
userGroup- user group to filter by, or null to ignoreuser- user to filter by, or null to ignorerole- role to filter by, or null to ignore- Returns:
- list of user role assignments matching the given filters
- Throws:
DAOException- if any.
-
addUserRole
addUserRole.- Parameters:
userRole- user role assignment to persist- Returns:
- true if user role was added successfully; false otherwise
- Throws:
DAOException- if any.
-
updateUserRole
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
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
getAllLicenseTypes.- Returns:
- list of all license types in the database
- Throws:
DAOException- if any.
-
getLicenseTypeCount
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
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
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 DAOExceptiongetLicenseTypes.- Parameters:
first- index of first result (pagination)pageSize- max number of results to returnsortField- field to sort bydescending- true for descending sort orderfilters- 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 DAOExceptiongetCoreLicenseTypes.- Parameters:
first- index of first result (pagination)pageSize- max number of results to returnsortField- field to sort bydescending- true for descending sort orderfilters- map of field names to filter values- Returns:
- list of core license types matching the given criteria
- Throws:
DAOException- if any.
-
getLicenseType
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
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
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
- Parameters:
licenseType- license type whose overriding types to retrieve- Returns:
- List of license types overriding given licenseType
- Throws:
DAOException
-
addLicenseType
addLicenseType.- Parameters:
licenseType- license type to persist- Returns:
- true if license type was added successfully; false otherwise
- Throws:
DAOException- if any.
-
updateLicenseType
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
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
getAllLicenses.- Returns:
- list of all licenses in the database
- Throws:
DAOException- if any.
-
getLicense
getLicense.- Parameters:
id- database primary key of the license- Returns:
- the matching license, or null if not found
- Throws:
DAOException- if any.
-
getLicenses
- Parameters:
licenseType- license type to filter by- Returns:
- List of
Licenses of the given licenseType - Throws:
DAOException
-
getLicenses
- Parameters:
licensee- licensee (user, group, or IP range) to filter by- Returns:
- List of
Licenses for the given licensee - Throws:
DAOException
-
getLicenseCount
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
addLicenseType.- Parameters:
license- license to persist- Returns:
- true if license was added successfully; false otherwise
- Throws:
DAOException- if any.
-
updateLicense
updateLicenseType.- Parameters:
license- license to update in the database- Returns:
- true if license was updated successfully; false otherwise
- Throws:
DAOException- if any.
-
deleteLicense
deleteLicenseType.- Parameters:
license- license to delete from the database- Returns:
- true if license was deleted successfully; false otherwise
- Throws:
DAOException- if any.
-
getTicket
- Parameters:
id- database id of the access ticket- Returns:
AccessTicketwith the given id- Throws:
DAOException
-
getTicketByPasswordHash
- Parameters:
passwordHash- password hash of the access ticket- Returns:
AccessTicketwith the given passwordHash- Throws:
DAOException
-
getActiveTicketCount
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 DAOExceptiongetActiveRecordAccessTickets.- Parameters:
first- First row indexpageSize- Number of rowssortField- field to sort bydescending- true if descending order requested; false otherwisefilters- Selected filters- Returns:
- list of active access tickets matching the given criteria
- Throws:
DAOException- if any.
-
getTicketRequests
- Returns:
AccessTickets with the requested status- Throws:
DAOException
-
addTicket
addTicket.- Parameters:
ticket- access ticket to persist- Returns:
- true if ticket was added successfully; false otherwise
- Throws:
DAOException- if any.
-
updateTicket
updateTicket.- Parameters:
ticket- access ticket to update in the database- Returns:
- true if ticket was updated successfully; false otherwise
- Throws:
DAOException- if any.
-
deleteTicket
deleteTicket.- Parameters:
ticket- access ticket to delete from the database- Returns:
- true if ticket was deleted successfully; false otherwise
- Throws:
DAOException- if any.
-
getAllIpRanges
getAllIpRanges.- Returns:
- list of all IP ranges in the database
- Throws:
DAOException- if any.
-
getIpRangeCount
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 DAOExceptiongetIpRanges.- Parameters:
first- index of first result (pagination)pageSize- max number of results to returnsortField- field to sort bydescending- true for descending sort orderfilters- map of field names to filter values- Returns:
- list of IP ranges matching the given criteria
- Throws:
DAOException- if any.
-
getIpRange
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
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
addIpRange.- Parameters:
ipRange- IP range to persist- Returns:
- true if IP range was added successfully; false otherwise
- Throws:
DAOException- if any.
-
updateIpRange
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
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
- Returns:
- All existing
CommentGroups - Throws:
DAOException
-
getCommentGroupUnfiltered
- Returns:
CommentGroup- Throws:
DAOException
-
getCommentGroup
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
addCommentGroup.- Parameters:
commentGroup- comment group to persist- Returns:
- true if comment group was added successfully; false otherwise
- Throws:
DAOException- if any.
-
updateCommentGroup
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
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
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 DAOExceptiongetCommentCount.- Parameters:
filters- map of field names to filter valuesowner- user who owns the comments, or null for all userstargetPIs- 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 DAOExceptiongetComments.- Parameters:
first- index of first result (pagination)pageSize- max number of results to returnsortField- field to sort bydescending- true for descending sort orderfilters- map of field names to filter valuestargetPIs- 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 commentmaxResults- maximum number of results to returnsortField- class field to sort results bydescending- set to "true" to sort descending- Returns:
- A list of at most maxResults comments.
- Throws:
DAOException
-
getCommentsForPage
getCommentsForPage.- Parameters:
pi- persistent identifier of the recordpage- page order number within the record- Returns:
- list of comments for the given record page
- Throws:
DAOException- if any.
-
getCommentsForWork
getCommentsForWork.- Parameters:
pi- persistent identifier of the record- Returns:
- list of all comments for the given record
- Throws:
DAOException- if any.
-
countCommentsForWork
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
getComment.- Parameters:
id- database primary key of the comment- Returns:
- the matching comment, or null if not found
- Throws:
DAOException- if any.
-
addComment
addComment.- Parameters:
comment- comment to persist- Returns:
- true if comment was added successfully; false otherwise
- Throws:
DAOException- if any.
-
updateComment
updateComment.- Parameters:
comment- comment to update in the database- Returns:
- true if comment was updated successfully; false otherwise
- Throws:
DAOException- if any.
-
deleteComment
deleteComment.- Parameters:
comment- comment to delete from the database- Returns:
- true if comment was deleted successfully; false otherwise
- Throws:
DAOException- if any.
-
deleteComments
- Parameters:
pi- Record identifierowner- Comment creator- Returns:
- Number of affected rows
- Throws:
DAOException- if any.
-
changeCommentsOwner
Changes ownership of all comments fromfromUsertotoUser.- Parameters:
fromUser- user whose comments are to be reassignedtoUser- user to reassign the comments to- Returns:
- Number of updated
Comments - Throws:
DAOException- if any.
-
getAllSearches
getAllSearches.- Returns:
- list of all saved searches in the database
- Throws:
DAOException- if any.
-
getSearchCount
getSearchCount.- Parameters:
owner- user who owns the searches, or null for all usersfilters- 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 DAOExceptiongetSearches.- Parameters:
owner- user who owns the searches, or null for all usersfirst- index of first result (pagination)pageSize- max number of results to returnsortField- field to sort bydescending- true for descending sort orderfilters- map of field names to filter values- Returns:
- list of saved searches matching the given criteria
- Throws:
DAOException- if any.
-
getSearches
getSearches.- Parameters:
owner- user whose saved searches to retrieve- Returns:
- list of saved searches owned by the given user
- Throws:
DAOException- if any.
-
getSearch
getSearch.- Parameters:
id- database primary key of the search- Returns:
- the matching saved search, or null if not found
- Throws:
DAOException- if any.
-
addSearch
addSearch.- Parameters:
search- saved search to persist- Returns:
- true if search was added successfully; false otherwise
- Throws:
DAOException- if any.
-
updateSearch
updateSearch.- Parameters:
search- saved search to update in the database- Returns:
- true if search was updated successfully; false otherwise
- Throws:
DAOException- if any.
-
deleteSearch
deleteSearch.- Parameters:
search- saved search to delete from the database- Returns:
- true if search was deleted successfully; false otherwise
- Throws:
DAOException- if any.
-
getUploadJobsWithStatus
- Parameters:
status-JobStatus- Returns:
- List of
UploadJobs with given status - Throws:
DAOException
-
getUploadJobsForCreatorId
- Parameters:
creatorId- User id of the creator- Returns:
UploadJobs belonging to user with given ID- Throws:
DAOException- if any.
-
addUploadJob
addDownloadJob.- Parameters:
uploadJob- upload job to persist- Returns:
- true if upload job was added successfully; false otherwise
- Throws:
DAOException- if any.
-
updateUploadJob
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
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
getAllCMSPages.- Returns:
- list of all CMS pages in the database
- Throws:
DAOException- if any.
-
getCmsPageForStaticPage
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 DAOExceptiongetCMSPageCount.- Parameters:
filters- map of field names to filter valuesallowedTemplates- list of template IDs the user is allowed to seeallowedSubthemes- list of subtheme identifiers the user is allowed to seeallowedCategories- 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
- Parameters:
propertyName- name of the CMS page property to filter bypropertyValue- 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 bypropertyValue- 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 DAOExceptiongetCMSPages.- Parameters:
first- index of first result (pagination)pageSize- max number of results to returnsortField- field to sort bydescending- true for descending sort orderfilters- map of field names to filter valuesallowedTemplates- list of template IDs the user is allowed to seeallowedSubthemes- list of subtheme identifiers the user is allowed to seeallowedCategories- 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
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
getCMSPagesForRecord.- Parameters:
pi- persistent identifier of the recordcategory- 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 returnfromDate- lower bound of the date range filter, or nulltoDate- 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 recordcategory- category to filter CMS pages by, or null for all categoriesfromDate- lower bound of the date range filter, or nulltoDate- 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
getCMSPageWithRelatedPiCount.- Parameters:
fromDate- lower bound of the date range filter, or nulltoDate- 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
- Parameters:
pi- Record identifier- Returns:
CMSPage- Throws:
DAOException
-
getCMSPageAccessConditions
- Returns:
- List
- Throws:
DAOException
-
getCMSPage
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
addCMSPage.- Parameters:
page- CMS page to persist- Returns:
- true if CMS page was added successfully; false otherwise
- Throws:
DAOException- if any.
-
updateCMSPage
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
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
- Throws:
DAOException
-
getCMSPageTemplate
- Throws:
DAOException
-
addCMSPageTemplate
- Throws:
DAOException
-
updateCMSPageTemplate
- Throws:
DAOException
-
removeCMSPageTemplate
- Throws:
DAOException
-
getAllCMSMediaItems
getAllCMSMediaItems.- Returns:
- list of all CMS media items in the database
- Throws:
DAOException- if any.
-
getAllCMSCollectionItems
getAllCMSCollectionItems.- Returns:
- list of all CMS media items that represent collections
- Throws:
DAOException- if any.
-
getCMSMediaItem
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
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
addCMSMediaItem.- Parameters:
item- CMS media item to persist- Returns:
- true if CMS media item was added successfully; false otherwise
- Throws:
DAOException- if any.
-
updateCMSMediaItem
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
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
Gets a list of allCMSMediaItems which contain the given category.- Parameters:
category- category to filter media items by- Returns:
- all containing cmsPages
- Throws:
DAOException
-
getAllStaticPages
getAllStaticPages.- Returns:
- list of all CMS static page mappings in the database
- Throws:
DAOException- if any.
-
addStaticPage
addStaticPage.- Parameters:
page- static page to persist- Returns:
- true if page added successfully; false otherwise
- Throws:
DAOException- if any.
-
updateStaticPage
updateStaticPage.- Parameters:
page- static page to update in the database- Returns:
- true if page updated successfully; false otherwise
- Throws:
DAOException- if any.
-
deleteStaticPage
deleteStaticPage.- Parameters:
page- static page to delete from the database- Returns:
- true if page deleted successfully; false otherwise
- Throws:
DAOException- if any.
-
getStaticPageForCMSPage
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
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 DAOExceptiongetCMSArchiveConfigs.- Parameters:
first- index of first result (pagination)pageSize- max number of results to returnsortField- field to sort bydescending- true for descending sort orderfilters- map of column filter values- Returns:
- List
- Throws:
DAOException- if any.
-
getCMSArchiveConfigCount
getCMSArchiveConfigCount.- Parameters:
filters- Selected filters- Returns:
- Number of found rows
- Throws:
DAOException- if any.
-
getCmsArchiveConfigForArchive
- Parameters:
pi- Archive record identifier- Returns:
- Optional
for the given pi; null if none found - Throws:
DAOException
-
saveCMSArchiveConfig
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
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
getAllCategories.- Returns:
- list of all CMS categories in the database
- Throws:
DAOException- if any.
-
getCountPagesUsingCategory
- Parameters:
category- category to count CMS pages for- Returns:
- Number of existing CMS pages having the given category
- Throws:
DAOException
-
getCountMediaItemsUsingCategory
- Parameters:
category- category to count CMS media items for- Returns:
- Number of existing CMS media items having the given category
- Throws:
DAOException
-
addCategory
addCategory.- Parameters:
category- CMS category to persist- Returns:
- true if category added successfully; false otherwise
- Throws:
DAOException- if any.
-
updateCategory
updateCategory.- Parameters:
category- CMS category to update in the database- Returns:
- true if category updated successfully; false otherwise
- Throws:
DAOException- if any.
-
deleteCategory
deleteCategory.- Parameters:
category- CMS category to delete from the database- Returns:
- true if category deleted successfully; false otherwise
- Throws:
DAOException- if any.
-
getCategoryByName
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
getCategory.- Parameters:
id- database primary key of the category- Returns:
- the matching CMS category, or null if not found
- Throws:
DAOException- if any.
-
getAllTranskribusJobs
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 ignoretranskribusUserId- Transkribus user ID to filter by, or null to ignorestatus- job status to filter by, or null to ignore- Returns:
- list of Transkribus jobs matching the given filters
- Throws:
DAOException- if any.
-
addTranskribusJob
addTranskribusJob.- Parameters:
job- Transkribus job to persist- Returns:
- true if job added successfully; false otherwise
- Throws:
DAOException- if any.
-
updateTranskribusJob
updateTranskribusJob.- Parameters:
job- Transkribus job to update in the database- Returns:
- true if job updated successfully; false otherwise
- Throws:
DAOException- if any.
-
deleteTranskribusJob
deleteTranskribusJob.- Parameters:
job- Transkribus job to delete from the database- Returns:
- true if job deleted successfully; false otherwise
- Throws:
DAOException- if any.
-
getAllCampaigns
getAllCampaigns.- Returns:
- list of all crowdsourcing campaigns in the database
- Throws:
DAOException- if any.
-
getCampaignCount
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
getCampaign.- Parameters:
id- database primary key of the campaign- Returns:
- the matching campaign, or null if not found
- Throws:
DAOException- if any.
-
getQuestion
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 DAOExceptiongetCampaigns.- Parameters:
first- index of first result (pagination)pageSize- max number of results to returnsortField- field to sort bydescending- true for descending sort orderfilters- 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 recordstatus- 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 recordstatus- 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
addCampaign.- Parameters:
campaign- crowdsourcing campaign to persist- Returns:
- true if campaign added successfully; false otherwise
- Throws:
DAOException- if any.
-
updateCampaign
updateCampaign.- Parameters:
campaign- crowdsourcing campaign to update in the database- Returns:
- true if campaign updated successfully; false otherwise
- Throws:
DAOException- if any.
-
deleteCampaign
deleteCampaign.- Parameters:
campaign- crowdsourcing campaign to delete from the database- Returns:
- true if campaign deleted successfully; false otherwise
- Throws:
DAOException- if any.
-
deleteCampaignStatisticsForUser
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
ReplacedfromUserwithtoUserin the lists of annotators and reviewers an all campaign statistics.- Parameters:
fromUser- user to be replaced in campaign statisticstoUser- 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
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
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
addCMSCollection.- Parameters:
collection- CMS collection to persist- Returns:
- true if CMS collection was added successfully; false otherwise
- Throws:
DAOException- if any.
-
updateCMSCollection
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
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
getCMSCollection.- Parameters:
solrField- Solr field name identifying the collection typesolrFieldValue- Solr field value identifying the collection- Returns:
- the matching CMS collection, or null if not found
- Throws:
DAOException- if any.
-
getAnnotation
Annotations *.- Parameters:
id- database primary key of the annotation- Returns:
- the matching crowdsourcing annotation, or null if not found
- Throws:
DAOException- if any.
-
getAnnotationsForCampaign
getAnnotationsForCampaign.- Parameters:
campaign- campaign whose annotations to retrieve- Returns:
- list of crowdsourcing annotations for the given campaign
- Throws:
DAOException- if any.
-
getAnnotationsForWork
getAnnotationsForWork.- Parameters:
pi- persistent identifier of the record- Returns:
- list of crowdsourcing annotations for the given record
- Throws:
DAOException- if any.
-
getAnnotationCountForWork
- 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 retrievepi- persistent identifier of the record- Returns:
- list of crowdsourcing annotations for the given campaign and record
- Throws:
DAOException- if any.
-
getAnnotationsForTarget
getAnnotationsForTarget.- Parameters:
pi- persistent identifier of the recordpage- 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 creatormaxResults- maximum number of results to returnsortField- field to sort bydescending- 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 DAOExceptiongetAnnotations.- Parameters:
first- index of first result (pagination)pageSize- max number of results to returnsortField- field to sort bydescending- true for descending sort orderfilters- map of field names to filter values- Returns:
- list of crowdsourcing annotations matching the given criteria
- Throws:
DAOException- if any.
-
getAnnotationCount
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
getAnnotationCountForTarget.- Parameters:
pi- persistent identifier of the recordpage- 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 retrievepi- persistent identifier of the recordpage- 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
addAnnotation.- Parameters:
annotation- crowdsourcing annotation to persist- Returns:
- true if annotation was added successfully; false otherwise
- Throws:
DAOException- if any.
-
updateAnnotation
updateAnnotation.- Parameters:
annotation- crowdsourcing annotation to update in the database- Returns:
- true if annotation was updated successfully; false otherwise
- Throws:
DAOException- if any.
-
deleteAnnotation
deleteAnnotation.- Parameters:
annotation- crowdsourcing annotation to delete from the database- Returns:
- true if annotation was deleted successfully; false otherwise
- Throws:
DAOException- if any.
-
getGeoMap
Gets theGeoMapof 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
Gets allGeoMaps in database.- Returns:
- A list of all stored GeoMaps
- Throws:
DAOException
-
addGeoMap
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
Updates the givenGeoMapin the database.- Parameters:
map- geo map to update- Returns:
- true if successful
- Throws:
DAOException
-
deleteGeoMap
Deletes the givenGeoMapfrom the database.- Parameters:
map- geo map to delete- Returns:
- true if successful
- Throws:
DAOException
-
getPagesUsingMap
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
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
- 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 DAOExceptionGets a paginated list ofCMSRecordNotes.- Parameters:
first- index of first result (pagination)pageSize- max number of results to returnsortField- field to sort bydescending- true for descending sort orderfilters- 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 allCMSRecordNotes for the given pi.- Parameters:
pi- The pi of the record.displayedNotesOnly- set to true to only return notes withCMSRecordNote.isDisplayNote()set to true- Returns:
- List of
CMSSingleRecordNotes for the given pi - Throws:
DAOException
-
getAllMultiRecordNotes
Get allCMSMultiRecordNotes. 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
Gets all persistedCMSRecordNotes.- Returns:
- List of all existing
CMSSingleRecordNotes - Throws:
DAOException
-
getRecordNote
Gets aCMSRecordNoteby its id property.- Parameters:
id- database id of the record note- Returns:
CMSSingleRecordNotewith the given id- Throws:
DAOException- if a database error occurs
-
addRecordNote
Persist a newCMSRecordNote.- Parameters:
note- record note to add- Returns:
- true if note added successfully; false otherwise
- Throws:
DAOException- if a database error occurs
-
updateRecordNote
Updates an existingCMSRecordNote.- Parameters:
note- record note to update- Returns:
- true if note updated successfully; false otherwise
- Throws:
DAOException- if a database error occurs
-
deleteRecordNote
Deletes an existingCMSRecordNote.- Parameters:
note- record note to delete- Returns:
- true if note deleted successfully; false otherwise
- Throws:
DAOException- if a database error occurs
-
saveTermsOfUse
- Throws:
DAOException
-
getTermsOfUse
- Throws:
DAOException
-
resetUserAgreementsToTermsOfUse
- Throws:
DAOException
-
getAllSliders
- Throws:
DAOException
-
getSlider
- Throws:
DAOException
-
addSlider
- Throws:
DAOException
-
updateSlider
- Throws:
DAOException
-
deleteSlider
- Throws:
DAOException
-
getPagesUsingSlider
- Throws:
DAOException
-
getConfiguredThemes
- Throws:
DAOException
-
getTheme
- Throws:
DAOException
-
addTheme
- Throws:
DAOException
-
updateTheme
- Throws:
DAOException
-
deleteTheme
- 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 returnsortField- field to sort bydescending- true for descending sort orderfilterString- JPQL WHERE clause fragment for additional filteringfilterParams- named parameters for the filterString clause- Returns:
- List of
CrowdsourcingAnnotations matching given filters - Throws:
DAOException
-
getAllAnnotationsByMotivation
- 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 bysortDescending- true for descending sort order- Returns:
- List of all existing
CrowdsourcingAnnotations, optionally sorted by given sortField - Throws:
DAOException
-
getTotalAnnotationCount
- Returns:
- Number of all existing
CrowdsourcingAnnotations - Throws:
DAOException
-
getAllCustomWidgets
- Throws:
DAOException
-
getCustomWidget
- Throws:
DAOException
-
addCustomWidget
- Throws:
DAOException
-
updateCustomWidget
- Throws:
DAOException
-
deleteCustomWidget
- Throws:
DAOException
-
getPagesUsingWidget
- Throws:
DAOException
-
getCookieBanner
- Throws:
DAOException
-
saveCookieBanner
- Throws:
DAOException
-
getDisclaimer
Get the single storedDisclaimer. May return null if no disclaimer has been persisted yet- Returns:
- the disclaimer or null
- Throws:
DAOException
-
saveDisclaimer
- Throws:
DAOException
-
getNumRecordsWithComments
- Throws:
DAOException
-
getNativeQueryResults
- Throws:
DAOException
-
executeUpdate
- Throws:
DAOException
-
getAllClientApplications
- Throws:
DAOException
-
getClientApplication
- Throws:
DAOException
-
saveClientApplication
- Throws:
DAOException
-
deleteClientApplication
- Throws:
DAOException
-
getClientApplicationByClientId
- Throws:
DAOException
-
getAllUsageStatistics
- Throws:
DAOException
-
getUsageStatistics
- Throws:
DAOException
-
getUsageStatistics
List<DailySessionUsageStatistics> getUsageStatistics(LocalDate start, LocalDate end) throws DAOException - Throws:
DAOException
-
addUsageStatistics
- Throws:
DAOException
-
updateUsageStatistics
- Throws:
DAOException
-
deleteUsageStatistics
- Throws:
DAOException
-
deleteCMSComponent
- Throws:
DAOException
-
deleteCMSContent
- Throws:
DAOException
-
addCMSComponent
- Throws:
DAOException
-
updatedCMSComponent
- Throws:
DAOException
-
getCMSComponent
- Throws:
DAOException
-
deleteViewerMessage
- Throws:
DAOException
-
addViewerMessage
- Throws:
DAOException
-
updateViewerMessage
- Throws:
DAOException
-
getViewerMessage
- Throws:
DAOException
-
getViewerMessageByMessageID
- Throws:
DAOException
-
getViewerMessages
List<ViewerMessage> getViewerMessages(int first, int pageSize, String sortField, boolean descending, Map<String, String> filters) throws DAOExceptiongetViewerMessages.- Parameters:
first- index of first result (pagination)pageSize- max number of results to returnsortField- field to sort bydescending- true for descending sort orderfilters- map of field names to filter values- Returns:
- list of viewer messages matching the given criteria
- Throws:
DAOException- if any.
-
getViewerMessageCount
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
- Throws:
DAOException
-
getRecurringTaskTrigger
- Throws:
DAOException
-
getRecurringTaskTriggerForTask
- Throws:
DAOException
-
addRecurringTaskTrigger
- Throws:
DAOException
-
updateRecurringTaskTrigger
- Throws:
DAOException
-
deleteRecurringTaskTrigger
- Throws:
DAOException
-
deleteViewerMessagesBefore
- Throws:
DAOException
-
addHighlight
- Throws:
DAOException
-
updateHighlight
- Throws:
DAOException
-
deleteHighlight
- Throws:
DAOException
-
getHighlight
- Throws:
DAOException
-
getAllHighlights
- Throws:
DAOException
-
getHighlights
List<HighlightData> getHighlights(int first, int pageSize, String sortField, boolean descending, Map<String, String> filters) throws DAOException- Throws:
DAOException
-
getHighlightsForDate
- 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
Returns the only existing instance of MaintenanceMode.- Returns:
- the singleton MaintenanceMode entity, or null if not yet persisted
- Throws:
DAOException- if any.
-
updateMaintenanceMode
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 byclose(EntityManager) Methodafter the query/transaction- Returns:
- a new EntityManager
-
close
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
CallgetTransaction()on the given EntityManager and thenbegin()on the transaction.- Parameters:
em- EntityManager- Returns:
- the transaction gotten from the entity manager
-
commitTransaction
CallEntityTransaction.commit()on the given transaction.- Parameters:
et- EntityTransaction- Throws:
PersistenceException
-
commitTransaction
CallEntityTransaction.commit()on the current transaction of the given EntityManager.- Parameters:
em- EntityManager- Throws:
PersistenceException
-
handleException
Handling of exceptions occurred duringcommitTransaction(EntityTransaction). Usually callsEntityTransaction.rollback()- Parameters:
et- EntityTransaction- Throws:
PersistenceException
-
handleException
Handling of exceptions occurred duringcommitTransaction(EntityManager)Usually callsEntityTransaction.rollback()on the current transaction of the given EntityManager.- Parameters:
em- EntityManager- Throws:
PersistenceException
-