Class UserBookmarkResourceBuilder
java.lang.Object
io.goobi.viewer.api.rest.resourcebuilders.AbstractBookmarkResourceBuilder
io.goobi.viewer.api.rest.resourcebuilders.UserBookmarkResourceBuilder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a new BookmarkList with the given name to the current users bookmark lists.addBookmarkList(String name) Adds a new BookmarkList with the given name to the current users bookmark lists.addBookmarkToBookmarkList(Long id, String pi) Adds a new Bookmark with the given pi to the current users bookmark list with the given id.addBookmarkToBookmarkList(Long id, String pi, String logId, String pageString) Adds a new Bookmark with the given pi, LOGID and page number to the current user's bookmark list with the given id.addUserBookmarkListFromSession(jakarta.servlet.http.HttpSession session) Adds the current session bookmark list to the current user bookmark lists under a newly generated name.addUserBookmarkListFromSession(String name, jakarta.servlet.http.HttpSession session) Adds the current session bookmark list to the current user's bookmark lists under the given name.Counts the items contained in the current user's bookmark list with the given id and returns the number as plain integer.de.intranda.api.iiif.presentation.v2.Collection2createCollection(BookmarkList list, AbstractApiUrlManager urls) deleteBookmarkFromBookmarkList(Long id, String pi) Removes a Bookmark with the given pi from the current users bookmark list with the given id.deleteBookmarkFromBookmarkList(Long id, String pi, String logId, String pageString) Removes a Bookmark with the given pi, logid and page number from the current users bookmark list with the given id.Deletes the current user's bookmark list with the given id.Returns all BookmarkList owned by the current user.de.intranda.api.iiif.presentation.v2.Collection2getAsCollection(Long id, AbstractApiUrlManager urls) getAsCollection.Returns the bookmark list with the given id, provided it is owned by the user or it is public or shared to him.Returns the user bookmark list with the given ID.Returns the bookmark list containing the object with the given pi if is contained in any bookmark list of the current user.getContainingUserBookmarkLists(String pi, String logId, String pageString) Returns the bookmark list containing the object with the given pi, logid and page number if is contained in any bookmark list of the current user.booleanisInGroup.voidupdateBookmarkList(BookmarkList bookmarkList) Methods inherited from class io.goobi.viewer.api.rest.resourcebuilders.AbstractBookmarkResourceBuilder
createCollection, getAllPublicBookmarkLists, getAsCollection, getPageOrder, getSharedBookmarkList, getSharedBookmarkListForMirador
-
Constructor Details
-
UserBookmarkResourceBuilder
-
-
Method Details
-
getAllBookmarkLists
Returns all BookmarkList owned by the current user.- Specified by:
getAllBookmarkListsin classAbstractBookmarkResourceBuilder- Returns:
- a
Listobject. - Throws:
DAOException- if any.IOException- if any.RestApiException- if any.
-
getBookmarkListById
Returns the bookmark list with the given id, provided it is owned by the user or it is public or shared to him.- Specified by:
getBookmarkListByIdin classAbstractBookmarkResourceBuilder- Parameters:
id- aLongobject.- Returns:
- a
BookmarkListobject. - Throws:
DAOException- if any.IOException- if any.RestApiException- if any.
-
addBookmarkToBookmarkList
public SuccessMessage addBookmarkToBookmarkList(Long id, String pi, String logId, String pageString) throws DAOException, IOException, RestApiException Adds a new Bookmark with the given pi, LOGID and page number to the current user's bookmark list with the given id. Returns 203 if no matching bookmark list was found or 400 if the Bookmark could not be created (wrong pi/logid/page).- Specified by:
addBookmarkToBookmarkListin classAbstractBookmarkResourceBuilder- Parameters:
id- aLongobject.pi- aStringobject.logId- aStringobject.pageString- aStringobject.- Returns:
- a
SuccessMessageobject. - Throws:
DAOException- if any.IOException- if any.RestApiException- if any.
-
addBookmarkToBookmarkList
public SuccessMessage addBookmarkToBookmarkList(Long id, String pi) throws DAOException, IOException, RestApiException Adds a new Bookmark with the given pi to the current users bookmark list with the given id. Returns 203 if no matching bookmark list was found or 400 if the Bookmark could not be created (wrong pi).- Specified by:
addBookmarkToBookmarkListin classAbstractBookmarkResourceBuilder- Parameters:
id- aLongobject.pi- aStringobject.- Returns:
- a
SuccessMessageobject. - Throws:
DAOException- if any.IOException- if any.RestApiException- if any.
-
deleteBookmarkFromBookmarkList
public SuccessMessage deleteBookmarkFromBookmarkList(Long id, String pi, String logId, String pageString) throws DAOException, IOException, RestApiException Removes a Bookmark with the given pi, logid and page number from the current users bookmark list with the given id. Returns 203 if no matching bookmark list was found or 400 if the requested Bookmark is invalid (wrong pi/logid/page).- Specified by:
deleteBookmarkFromBookmarkListin classAbstractBookmarkResourceBuilder- Parameters:
id- aLongobject.pi- aStringobject.logId- aStringobject.pageString- aStringobject.- Returns:
- a
SuccessMessageobject. - Throws:
DAOException- if any.IOException- if any.RestApiException- if any.
-
deleteBookmarkFromBookmarkList
public SuccessMessage deleteBookmarkFromBookmarkList(Long id, String pi) throws DAOException, IOException, RestApiException Removes a Bookmark with the given pi from the current users bookmark list with the given id. Returns 203 if no matching bookmark list was found or 400 if the requested Bookmark is invalid (wrong pi).- Specified by:
deleteBookmarkFromBookmarkListin classAbstractBookmarkResourceBuilder- Parameters:
id- aLongobject.pi- aStringobject.- Returns:
- a
SuccessMessageobject. - Throws:
DAOException- if any.IOException- if any.RestApiException- if any.
-
addBookmarkList
public SuccessMessage addBookmarkList(String name) throws DAOException, IOException, RestApiException Adds a new BookmarkList with the given name to the current users bookmark lists.- Specified by:
addBookmarkListin classAbstractBookmarkResourceBuilder- Parameters:
name- aStringobject.- Returns:
- a
SuccessMessageobject. - Throws:
DAOException- if any.IOException- if any.RestApiException- if any.
-
addBookmarkList
Adds a new BookmarkList with the given name to the current users bookmark lists.- Specified by:
addBookmarkListin classAbstractBookmarkResourceBuilder- Returns:
- a
SuccessMessageobject. - Throws:
DAOException- if any.IOException- if any.RestApiException- if any.
-
addUserBookmarkListFromSession
public SuccessMessage addUserBookmarkListFromSession(jakarta.servlet.http.HttpSession session) throws DAOException, IOException, RestApiException Adds the current session bookmark list to the current user bookmark lists under a newly generated name.- Parameters:
session-- Returns:
- a
SuccessMessageobject. - Throws:
DAOException- if any.IOException- if any.RestApiException- if any.
-
addUserBookmarkListFromSession
public SuccessMessage addUserBookmarkListFromSession(String name, jakarta.servlet.http.HttpSession session) throws DAOException, IOException, RestApiException Adds the current session bookmark list to the current user's bookmark lists under the given name.- Parameters:
name- aStringobject.session-- Returns:
- a
SuccessMessageobject. - Throws:
DAOException- if any.IOException- if any.RestApiException- if any.
-
deleteBookmarkList
public SuccessMessage deleteBookmarkList(Long id) throws DAOException, IOException, RestApiException Deletes the current user's bookmark list with the given id. If no such bookmark list could be found a message with 'success:false' is returned, otherwise one with 'success:true'.- Specified by:
deleteBookmarkListin classAbstractBookmarkResourceBuilder- Parameters:
id- The bookmark list id- Returns:
- an object containing the boolean property 'success', detailing wether the operation was successfull
- Throws:
DAOException- if any.IOException- if any.RestApiException- if any.
-
getBookmarkListForMirador
public String getBookmarkListForMirador(Long id, AbstractApiUrlManager urls) throws DAOException, IOException, RestApiException, ViewerConfigurationException, IndexUnreachableException, PresentationException Returns the user bookmark list with the given ID.- Specified by:
getBookmarkListForMiradorin classAbstractBookmarkResourceBuilder- Parameters:
id- aLongobject.- Returns:
- a
Stringobject. - Throws:
DAOException- if any.IOException- if any.RestApiException- if any.ViewerConfigurationException- if any.IndexUnreachableException- if any.PresentationException- if any.
-
getContainingUserBookmarkLists
public List<BookmarkList> getContainingUserBookmarkLists(String pi, String logId, String pageString) throws DAOException, IOException, RestApiException Returns the bookmark list containing the object with the given pi, logid and page number if is contained in any bookmark list of the current user. Otherwise an json object with the property "success:false" is returned.- Parameters:
pi- aStringobject.logId- aStringobject.pageString- aStringobject.- Returns:
- a
Listobject. - Throws:
DAOException- if any.IOException- if any.RestApiException- if any.
-
getContainingUserBookmarkLists
public List<BookmarkList> getContainingUserBookmarkLists(String pi) throws DAOException, IOException, RestApiException Returns the bookmark list containing the object with the given pi if is contained in any bookmark list of the current user. Otherwise an json object with the property "success:false" is returned.- Parameters:
pi- aStringobject.- Returns:
- a
Listobject. - Throws:
DAOException- if any.IOException- if any.RestApiException- if any.
-
countUserBookmarks
Counts the items contained in the current user's bookmark list with the given id and returns the number as plain integer. If no session store bookmark list exists, 0 is returned.- Parameters:
id- aLongobject.- Returns:
- a
Longobject. - Throws:
RestApiException- if any.DAOException- if any.IOException- if any.
-
isInGroup
isInGroup.
-
getAsCollection
public de.intranda.api.iiif.presentation.v2.Collection2 getAsCollection(Long id, AbstractApiUrlManager urls) throws DAOException, RestApiException getAsCollection.
- Specified by:
getAsCollectionin classAbstractBookmarkResourceBuilder- Parameters:
id- aLongobject.- Returns:
- a
Collection2object. - Throws:
DAOException- if any.RestApiException- if any.
-
createCollection
public de.intranda.api.iiif.presentation.v2.Collection2 createCollection(BookmarkList list, AbstractApiUrlManager urls) - Specified by:
createCollectionin classAbstractBookmarkResourceBuilder
-
updateBookmarkList
public void updateBookmarkList(BookmarkList bookmarkList) throws de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException, DAOException - Specified by:
updateBookmarkListin classAbstractBookmarkResourceBuilder- Parameters:
bookmarkList-- Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestExceptionDAOException
-