Package io.goobi.viewer.model.bookmark
Class BookmarkList
java.lang.Object
io.goobi.viewer.model.bookmark.BookmarkList
- All Implemented Interfaces:
Serializable,Comparable<BookmarkList>
Represents a named list of bookmarks owned by a user, optionally shareable with others.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddGroupShare(UserGroup group) Add user group to list and save.booleanAdd bookshelf to list and save.intDescending order by dateUpdated.booleanvoidGenerates a persistent share key for public sharing via link.Returns a Solr query that would retrieve the Solr documents representing the items listed on this bookshelf.Getter for the fielddescription.getFilterQuery.Getter for the fieldgroupShares.getId()Getter for the fieldid.getIIIFCollectionURI.getItems()Getter for the fielditems.getMiradorJsonObject(String applicationRoot, String restApiUrl) getMiradorJsonObject.getName()Getter for the fieldname.intgetNumItems.getOwner()Getter for the fieldowner.getOwnerName.getPublicString.Getter for the fieldshareKey.booleanhasDescription.inthashCode()booleanbooleanisIsPublic.booleanisMayEdit.booleanisMayView.booleanlongbooleanremoveGroupShare(UserGroup group) Remove user group from list and save.booleanremoveItem(Bookmark item) Remove bookshelf from list and save.voidRemoves the share key.voidsetDateUpdated(LocalDateTime dateUpdated) voidsetDescription(String description) Setter for the fielddescription.voidsetGroupShares(List<UserGroup> groupShares) Setter for the fieldgroupShares.voidSetter for the fieldid.voidsetIsPublic(boolean isPublic) Setter for the fieldisPublic.voidSetter for the fielditems.voidSetter for the fieldname.voidSetter for the fieldowner.voidsetShareKey(String shareKey) Setter for the fieldshareKey.static voidsortBookmarkLists(List<BookmarkList> bookmarkLists)
-
Field Details
-
MIRADOR_LIB_PATH
- See Also:
-
-
Constructor Details
-
BookmarkList
public BookmarkList()
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
compareTo
Descending order by dateUpdated.- Specified by:
compareToin interfaceComparable<BookmarkList>- Parameters:
o- the other bookmark list to compare to- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object
-
addItem
Add bookshelf to list and save.- Parameters:
item- bookmark to add to this list- Returns:
- boolean if list changed
-
removeItem
Remove bookshelf from list and save.- Parameters:
item- bookmark to remove from this list- Returns:
- boolean if list changed
-
generateSolrQueryForItems
Returns a Solr query that would retrieve the Solr documents representing the items listed on this bookshelf.- Returns:
- the Solr query string matching all records in this bookmark list
-
isMayView
isMayView.- Parameters:
user- user requesting view access; may be null for anonymous- Returns:
- true if the list is public, if the user is the owner, or if the list has been shared with the user, false otherwise
- Throws:
DAOException- if any.
-
isMayEdit
isMayEdit.- Parameters:
user- user requesting edit access; may be null- Returns:
- true if the user is the owner or a member/owner of a group with which this list is shared, false otherwise
- Throws:
DAOException- if any.
-
getId
Getter for the fieldid.- Returns:
- the database primary key of this bookmark list
-
setId
Setter for the fieldid.- Parameters:
id- the database ID to set
-
getName
Getter for the fieldname.- Returns:
- the display name of this bookmark list
-
setName
Setter for the fieldname.- Parameters:
name- the display name of this bookmark list; leading and trailing whitespace is trimmed
-
getDescription
Getter for the fielddescription.- Returns:
- an optional description of this bookmark list
-
setDescription
Setter for the fielddescription.- Parameters:
description- an optional description of this bookmark list
-
hasDescription
public boolean hasDescription()hasDescription.- Returns:
- true if this bookmark list has a non-blank description, false otherwise
-
getOwner
Getter for the fieldowner.- Returns:
- the user who owns this bookmark list
-
setOwner
Setter for the fieldowner.- Parameters:
owner- the user who owns this bookmark list
-
isIsPublic
public boolean isIsPublic()isIsPublic.- Returns:
- true if this bookmark list is publicly visible without authentication, false otherwise
-
getPublicString
getPublicString.- Returns:
- the isPublic Value as a String
surrounded with ()
-
setIsPublic
public void setIsPublic(boolean isPublic) Setter for the fieldisPublic.- Parameters:
isPublic- true to make this list publicly visible without authentication
-
getDateUpdated
-
setDateUpdated
-
getNumItems
public int getNumItems()getNumItems.- Returns:
- Number of items
-
getItems
Getter for the fielditems.- Returns:
- the list of bookmarks contained in this bookmark list
-
setItems
Setter for the fielditems.- Parameters:
items- the list of bookmarks contained in this bookmark list
-
getOwnerName
getOwnerName.- Returns:
- the display name of the owner of this bookmark list, or null if no owner is set
-
getMiradorJsonObject
public String getMiradorJsonObject(String applicationRoot, String restApiUrl) throws ViewerConfigurationException, IndexUnreachableException, PresentationException getMiradorJsonObject.- Parameters:
applicationRoot- aStringobject.restApiUrl- base URL of the REST API for manifest links- Returns:
- the Mirador viewer JSON configuration object for this bookmark list
- Throws:
ViewerConfigurationException- if any.IndexUnreachableException- if any.PresentationException- if any.
-
getLegacyManifestUrl
- Parameters:
pi- persistent identifier of the record- Returns:
- Generated URL
-
getFilterQuery
getFilterQuery.- Returns:
- the Solr filter query string matching all PI values in this bookmark list
-
getIIIFCollectionURI
getIIIFCollectionURI.- Returns:
- the IIIF Collection URI for this shared bookmark list, or null if the list has no share key
-
getEscapedName
- Returns:
- the URL encoded name
-
isOwnedBy
-
numItemsWithoutImages
public long numItemsWithoutImages() -
sortBookmarkLists
- Parameters:
bookmarkLists- list of bookmark lists to sort in place
-