Class UserBookmarkResourceBuilder
java.lang.Object
io.goobi.viewer.api.rest.resourcebuilders.AbstractBookmarkResourceBuilder
io.goobi.viewer.api.rest.resourcebuilders.UserBookmarkResourceBuilder
-
Constructor Summary
-
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
(String name, javax.servlet.http.HttpSession session) Adds the current session bookmark list to the current user's bookmark lists under the given name.addUserBookmarkListFromSession
(javax.servlet.http.HttpSession session) Adds the current session bookmark list to the current user bookmark lists under a newly generated 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.Collection2
createCollection
(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.Collection2
getAsCollection
(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.boolean
isInGroup.void
updateBookmarkList
(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:
getAllBookmarkLists
in classAbstractBookmarkResourceBuilder
- Returns:
- a
List
object. - 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:
getBookmarkListById
in classAbstractBookmarkResourceBuilder
- Parameters:
id
- aLong
object.- Returns:
- a
BookmarkList
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 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:
addBookmarkToBookmarkList
in classAbstractBookmarkResourceBuilder
- Parameters:
id
- aLong
object.pi
- aString
object.logId
- aString
object.pageString
- aString
object.- Returns:
- a
SuccessMessage
object. - 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:
addBookmarkToBookmarkList
in classAbstractBookmarkResourceBuilder
- Parameters:
id
- aLong
object.pi
- aString
object.- Returns:
- a
SuccessMessage
object. - 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:
deleteBookmarkFromBookmarkList
in classAbstractBookmarkResourceBuilder
- Parameters:
id
- aLong
object.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 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:
deleteBookmarkFromBookmarkList
in classAbstractBookmarkResourceBuilder
- Parameters:
id
- aLong
object.pi
- aString
object.- Returns:
- a
SuccessMessage
object. - 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:
addBookmarkList
in classAbstractBookmarkResourceBuilder
- Parameters:
name
- aString
object.- Returns:
- a
SuccessMessage
object. - 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:
addBookmarkList
in classAbstractBookmarkResourceBuilder
- Returns:
- a
SuccessMessage
object. - Throws:
DAOException
- if any.IOException
- if any.RestApiException
- if any.
-
addUserBookmarkListFromSession
public SuccessMessage addUserBookmarkListFromSession(javax.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
SuccessMessage
object. - Throws:
DAOException
- if any.IOException
- if any.RestApiException
- if any.
-
addUserBookmarkListFromSession
public SuccessMessage addUserBookmarkListFromSession(String name, javax.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
- aString
object.session
-- Returns:
- a
SuccessMessage
object. - 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:
deleteBookmarkList
in 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:
getBookmarkListForMirador
in classAbstractBookmarkResourceBuilder
- Parameters:
id
- aLong
object.- Returns:
- a
String
object. - 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
- aString
object.logId
- aString
object.pageString
- aString
object.- Returns:
- a
List
object. - 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
- aString
object.- Returns:
- a
List
object. - 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
- aLong
object.- Returns:
- a
Long
object. - 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:
getAsCollection
in classAbstractBookmarkResourceBuilder
- Parameters:
id
- aLong
object.- Returns:
- a
Collection2
object. - Throws:
DAOException
- if any.RestApiException
- if any.
-
createCollection
public de.intranda.api.iiif.presentation.v2.Collection2 createCollection(BookmarkList list, AbstractApiUrlManager urls) - Specified by:
createCollection
in classAbstractBookmarkResourceBuilder
-
updateBookmarkList
public void updateBookmarkList(BookmarkList bookmarkList) throws de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException, DAOException - Specified by:
updateBookmarkList
in classAbstractBookmarkResourceBuilder
- Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
DAOException
-