Class SessionBookmarkResourceBuilder
java.lang.Object
io.goobi.viewer.api.rest.resourcebuilders.AbstractBookmarkResourceBuilder
io.goobi.viewer.api.rest.resourcebuilders.SessionBookmarkResourceBuilder
-
Constructor Summary
-
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.Collection2
createCollection
(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.Collection2
getAsCollection
(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.void
Methods inherited from class io.goobi.viewer.api.rest.resourcebuilders.AbstractBookmarkResourceBuilder
createCollection, getAllPublicBookmarkLists, getAsCollection, getPageOrder, getSharedBookmarkListForMirador
-
Constructor Details
-
SessionBookmarkResourceBuilder
public SessionBookmarkResourceBuilder(javax.servlet.http.HttpSession session)
-
-
Method Details
-
getAllBookmarkLists
Returns the session stored bookmark list, creating a new empty one if needed.- Specified by:
getAllBookmarkLists
in classAbstractBookmarkResourceBuilder
- Returns:
- a
BookmarkList
object. - 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:
getBookmarkListForMirador
in classAbstractBookmarkResourceBuilder
- Parameters:
id
-urls
-- Returns:
- a
String
object. - 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:
addBookmarkToBookmarkList
in classAbstractBookmarkResourceBuilder
- Parameters:
id
-pi
- aString
object.- Returns:
- a
SuccessMessage
object. - 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:
addBookmarkToBookmarkList
in classAbstractBookmarkResourceBuilder
- Parameters:
id
-pi
- aString
object.logId
- aString
object.pageString
- aString
object.- Returns:
- a
SuccessMessage
object. - 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:
deleteBookmarkFromBookmarkList
in classAbstractBookmarkResourceBuilder
- Parameters:
id
-pi
- aString
object.- 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:
deleteBookmarkFromBookmarkList
in classAbstractBookmarkResourceBuilder
- Parameters:
id
-pi
- aString
object.logId
- aString
object.pageString
- aString
object.- 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
SuccessMessage
object. - 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
- aString
object.- Returns:
- a
Boolean
object. - 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
- aString
object.logId
- aString
object.pageString
- aString
object.- Returns:
- a
Boolean
object. - 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
Integer
object. - 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
- aLong
object.- Returns:
- a
BookmarkList
object. - 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:
createCollection
in classAbstractBookmarkResourceBuilder
-
addBookmarkList
public SuccessMessage addBookmarkList() throws DAOException, IOException, RestApiException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException- Specified by:
addBookmarkList
in classAbstractBookmarkResourceBuilder
- Throws:
DAOException
IOException
RestApiException
de.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:
addBookmarkList
in classAbstractBookmarkResourceBuilder
- Throws:
DAOException
IOException
RestApiException
de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
-
getBookmarkListById
- Specified by:
getBookmarkListById
in classAbstractBookmarkResourceBuilder
- Throws:
DAOException
IOException
RestApiException
-
updateBookmarkList
public void updateBookmarkList(BookmarkList list) throws de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException - Specified by:
updateBookmarkList
in classAbstractBookmarkResourceBuilder
- 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:
deleteBookmarkList
in classAbstractBookmarkResourceBuilder
- Throws:
DAOException
IOException
RestApiException
de.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:
getAsCollection
in classAbstractBookmarkResourceBuilder
- Throws:
DAOException
RestApiException
IOException
-