Class SessionBookmarkResourceBuilder
java.lang.Object
io.goobi.viewer.api.rest.resourcebuilders.AbstractBookmarkResourceBuilder
io.goobi.viewer.api.rest.resourcebuilders.SessionBookmarkResourceBuilder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddBookmarkList(String name) addBookmarkToBookmarkList(Long id, String pi) Adds an item with the given pi to the session stored bookmark list, creating a new bookmark list if needed.addBookmarkToBookmarkList(Long id, String pi, String logId, String pageString) Adds an item with the given pi, logid and page number to the session stored bookmark list, creating a new bookmark list if needed.Counts the items contained in the session store bookmark list and returns the number as plain integer.de.intranda.api.iiif.presentation.v2.Collection2createCollection(BookmarkList list, AbstractApiUrlManager urls) deleteBookmarkFromBookmarkList(Long id, String pi) Deletes the bookmark with the given pi from the session store bookmark list.deleteBookmarkFromBookmarkList(Long id, String pi, String logId, String pageString) Deletes the bookmark with the given pi, logid and page number from the session store bookmark list.Deletes the entry bookmark list from the session store.Returns the session stored bookmark list, creating a new empty one if needed.de.intranda.api.iiif.presentation.v2.Collection2getAsCollection(Long id, AbstractApiUrlManager urls) Returns the session stored bookmark list, creating a new empty one if needed.getSharedBookmarkList(String shareKey) Returns the bookmark list with the given id, provided it is owned by the user or it is public or shared to him.Returns "true" if the object with the given IP is in the session store bookmark list, "false" otherwise.isInSessionBookmarkList(String pi, String logId, String pageString) Returns "true" if the object with the given IP, logid and page number is in the session store bookmark list, "false" otherwise.voidMethods inherited from class io.goobi.viewer.api.rest.resourcebuilders.AbstractBookmarkResourceBuilder
createCollection, getAllPublicBookmarkLists, getAsCollection, getPageOrder, getSharedBookmarkListForMirador
-
Constructor Details
-
SessionBookmarkResourceBuilder
public SessionBookmarkResourceBuilder(jakarta.servlet.http.HttpSession session)
-
-
Method Details
-
getAllBookmarkLists
Returns the session stored bookmark list, creating a new empty one if needed.- Specified by:
getAllBookmarkListsin classAbstractBookmarkResourceBuilder- Returns:
- a
BookmarkListobject. - 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 session stored bookmark list, creating a new empty one if needed.- Specified by:
getBookmarkListForMiradorin classAbstractBookmarkResourceBuilder- Parameters:
id-urls-- Returns:
- a
Stringobject. - Throws:
DAOException- if any.IOException- if any.RestApiException- if any.ViewerConfigurationException- if any.IndexUnreachableException- if any.PresentationException- if any.
-
addBookmarkToBookmarkList
public SuccessMessage addBookmarkToBookmarkList(Long id, String pi) throws DAOException, IOException, RestApiException Adds an item with the given pi to the session stored bookmark list, creating a new bookmark list if needed.- Specified by:
addBookmarkToBookmarkListin classAbstractBookmarkResourceBuilder- Parameters:
id-pi- aStringobject.- Returns:
- a
SuccessMessageobject. - 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 an item with the given pi, logid and page number to the session stored bookmark list, creating a new bookmark list if needed.- Specified by:
addBookmarkToBookmarkListin classAbstractBookmarkResourceBuilder- Parameters:
id-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 Deletes the bookmark with the given pi from the session store bookmark list. This operation returns an object with the property "success: false" if the operation failed (usually because the object wasn't in the bookmark list to begin with). Otherwise the return object contains "success: true"- Specified by:
deleteBookmarkFromBookmarkListin classAbstractBookmarkResourceBuilder- Parameters:
id-pi- aStringobject.- Returns:
- an object containing the boolean property 'success', detailing wether the operation was successfull
- Throws:
DAOException- if any.IOException- if any.RestApiException- if any.
-
deleteBookmarkFromBookmarkList
public SuccessMessage deleteBookmarkFromBookmarkList(Long id, String pi, String logId, @PathParam("page") String pageString) throws DAOException, IOException, RestApiException Deletes the bookmark with the given pi, logid and page number from the session store bookmark list. This operation returns an object with the property "success: false" if the operation failed (usually because the object wasn't in the bookmark list to begin with). Otherwise the return object contains "success: true"- Specified by:
deleteBookmarkFromBookmarkListin classAbstractBookmarkResourceBuilder- Parameters:
id-pi- aStringobject.logId- aStringobject.pageString- aStringobject.- Returns:
- an object containing the boolean property 'success', detailing wether the operation was successfull
- Throws:
DAOException- if any.IOException- if any.RestApiException- if any.
-
deleteSessionBookmarkList
Deletes the entry bookmark list from the session store. Always returns an object with the property "success: true", unless an error occurs in which case an error status code and an error object is returned- Returns:
- a
SuccessMessageobject. - Throws:
RestApiException- if any.
-
isInSessionBookmarkList
public Boolean isInSessionBookmarkList(String pi) throws DAOException, IOException, RestApiException Returns "true" if the object with the given IP is in the session store bookmark list, "false" otherwise.- Parameters:
pi- aStringobject.- Returns:
- a
Booleanobject. - Throws:
DAOException- if any.IOException- if any.RestApiException- if any.
-
isInSessionBookmarkList
public Boolean isInSessionBookmarkList(String pi, String logId, String pageString) throws DAOException, IOException, RestApiException Returns "true" if the object with the given IP, logid and page number is in the session store bookmark list, "false" otherwise.- Parameters:
pi- aStringobject.logId- aStringobject.pageString- aStringobject.- Returns:
- a
Booleanobject. - Throws:
DAOException- if any.IOException- if any.RestApiException- if any.
-
countSessionBookmarks
Counts the items contained in the session store bookmark list and returns the number as plain integer. If no session store bookmark list exists, 0 is returned- Returns:
- a
Integerobject. - Throws:
RestApiException- if any.
-
getUserBookmarkListById
public BookmarkList getUserBookmarkListById(Long id) throws DAOException, IOException, RestApiException Returns the bookmark list with the given id, provided it is owned by the user or it is public or shared to him.- Parameters:
id- aLongobject.- Returns:
- a
BookmarkListobject. - Throws:
DAOException- if any.IOException- if any.RestApiException- if any.
-
createCollection
public de.intranda.api.iiif.presentation.v2.Collection2 createCollection(BookmarkList list, AbstractApiUrlManager urls) - Specified by:
createCollectionin classAbstractBookmarkResourceBuilder
-
addBookmarkList
public SuccessMessage addBookmarkList() throws DAOException, IOException, RestApiException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException- Specified by:
addBookmarkListin classAbstractBookmarkResourceBuilder- Throws:
DAOExceptionIOExceptionRestApiExceptionde.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
-
addBookmarkList
public SuccessMessage addBookmarkList(String name) throws DAOException, IOException, RestApiException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException - Specified by:
addBookmarkListin classAbstractBookmarkResourceBuilder- Throws:
DAOExceptionIOExceptionRestApiExceptionde.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
-
getBookmarkListById
- Specified by:
getBookmarkListByIdin classAbstractBookmarkResourceBuilder- Throws:
DAOExceptionIOExceptionRestApiException
-
updateBookmarkList
public void updateBookmarkList(BookmarkList list) throws de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException - Specified by:
updateBookmarkListin classAbstractBookmarkResourceBuilder- Parameters:
list-- Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
-
deleteBookmarkList
public SuccessMessage deleteBookmarkList(Long id) throws DAOException, IOException, RestApiException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException - Specified by:
deleteBookmarkListin classAbstractBookmarkResourceBuilder- Throws:
DAOExceptionIOExceptionRestApiExceptionde.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
-
getAsCollection
public de.intranda.api.iiif.presentation.v2.Collection2 getAsCollection(Long id, AbstractApiUrlManager urls) throws DAOException, RestApiException, IOException - Specified by:
getAsCollectionin classAbstractBookmarkResourceBuilder- Throws:
DAOExceptionRestApiExceptionIOException
-