Package io.goobi.viewer.model.bookmark
Class Bookmark
java.lang.Object
io.goobi.viewer.model.bookmark.Bookmark
- All Implemented Interfaces:
Serializable
Represents a single bookmark entry linking a user to a specific record or page.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBookmark()Empty constructor.Creates a new bookmark based in book pi, section logId and page order logId and order my be empty or null, if only the book itself is references.Creates a new bookmark based in book pi, section logId and page order logId and order my be empty or null, if only the book itself is references.Creates a new Bookmark instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbothEqualOrBlank(String o1, String o2) bothEqualOrBlank.booleanbothEqualOrNull(Object o1, Object o2) bothEqualOrNull.booleanGetter for the fieldbookmarkList.Getter for the fielddateAdded.Getter for the fielddescription.Retrieves the documents title from the Solr index using the stored pi and - if nonempty - the logId.getId()Getter for the fieldid.getLogId()Getter for the fieldlogId.getName()Getter for the fieldname.getOrder()Getter for the fieldorder.getPi()Getter for the fieldpi.Returns the URL to the representative image thumbnail for the record represented by this item.getRepresentativeImageUrl(int width, int height) Returns the URL to the representative image thumbnail for the record represented by this item.0.getUrl()Returns the image view URL for this bookmark.getUrn()Getter for the fieldurn.inthashCode()booleanvoidsetBookmarkList(BookmarkList bookmarkList) Setter for the fieldbookmarkList.voidsetDateAdded(LocalDateTime dateAdded) Setter for the fielddateAdded.voidsetDescription(String description) Setter for the fielddescription.voidSetter for the fieldid.voidSetter for the fieldlogId.voidSetter for the fieldname.voidSetter for the fieldorder.voidSetter for the fieldpi.voidSetter for the fieldurn.
-
Constructor Details
-
Bookmark
public Bookmark()Empty constructor. -
Bookmark
Creates a new Bookmark instance.- Parameters:
pi- persistent identifier of the recordmainTitle- main title of the bookmarked recordname- display name for this bookmark
-
Bookmark
public Bookmark(String pi, String logId, Integer order) throws IndexUnreachableException, PresentationException Creates a new bookmark based in book pi, section logId and page order logId and order my be empty or null, if only the book itself is references. PI must be non-empty, otherwise a NullPointerException is thrown The item name will be inferred from the book/section title from Solr. If that fails, an IndexUnreachableException or PresentationException is thrown- Parameters:
pi- persistent identifier of the recordlogId- structural element log ID, may be null or emptyorder- page order number, may be null- Throws:
NullPointerException- if pi is null or blankIndexUnreachableException- if any.PresentationException- if any.
-
Bookmark
public Bookmark(String pi, String logId, Integer order, boolean ignoreMissingSolrDoc) throws IndexUnreachableException, PresentationException Creates a new bookmark based in book pi, section logId and page order logId and order my be empty or null, if only the book itself is references. PI must be non-empty, otherwise a NullPointerException is thrown The item name will be inferred from the book/section title from Solr. If that fails, an IndexUnreachableException or PresentationException is thrown- Parameters:
pi- persistent identifier of the recordlogId- structural element log ID, may be null or emptyorder- page order number, may be nullignoreMissingSolrDoc- should be false, unless arbitrary pi/logid values should be allowed (e.g. for testing)- Throws:
NullPointerException- if pi is null or blankIndexUnreachableException- if any.PresentationException- if any.
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
bothEqualOrNull
bothEqualOrNull.- Parameters:
o1- first object to compareo2- second object to compare- Returns:
- true if both objects are null or if o1 equals o2, false otherwise
-
bothEqualOrBlank
bothEqualOrBlank.- Parameters:
o1- first string to compareo2- second string to compare- Returns:
- true if both strings are blank or if they are equal after trimming, false otherwise
-
getUrl
Returns the image view URL for this bookmark. If this is the first call, the url is constructed first.- Returns:
- The URL as string.
- Throws:
PresentationException- if any.IndexUnreachableException- if any.
-
getRepresentativeImageUrl
public String getRepresentativeImageUrl() throws PresentationException, IndexUnreachableException, ViewerConfigurationException, DAOExceptionReturns the URL to the representative image thumbnail for the record represented by this item.- Returns:
- the thumbnail URL for the representative image of this bookmarked record at default dimensions
- Throws:
PresentationException- if any.IndexUnreachableException- if any.ViewerConfigurationException- if any.DAOException- if any.
-
getRepresentativeImageUrl
public String getRepresentativeImageUrl(int width, int height) throws PresentationException, IndexUnreachableException, ViewerConfigurationException, DAOException Returns the URL to the representative image thumbnail for the record represented by this item.- Parameters:
width- desired thumbnail width in pixelsheight- desired thumbnail height in pixels- Returns:
- the thumbnail URL for the representative image of this bookmarked record scaled to the given dimensions
- Throws:
PresentationException- if any.IndexUnreachableException- if any.ViewerConfigurationException- if any.DAOException- if any.
-
getDocumentTitle
Retrieves the documents title from the Solr index using the stored pi and - if nonempty - the logId.- Returns:
- the title of the bookmarked document as retrieved from the Solr index
- Throws:
IndexUnreachableException- if any.PresentationException- if any.
-
getId
Getter for the fieldid.- Returns:
- the database primary key of this bookmark
-
setId
Setter for the fieldid.- Parameters:
id- the database ID to set
-
getBookmarkList
Getter for the fieldbookmarkList.- Returns:
- the parent bookmark list this item belongs to
-
setBookmarkList
Setter for the fieldbookmarkList.- Parameters:
bookmarkList- the parent bookmark list this item belongs to
-
getPi
Getter for the fieldpi.- Returns:
- the persistent identifier of the bookmarked record
-
setPi
Setter for the fieldpi.- Parameters:
pi- the persistent identifier of the bookmarked record
-
getLogId
Getter for the fieldlogId.- Returns:
- the METS logical structure ID identifying a specific section within the record
-
setLogId
Setter for the fieldlogId.- Parameters:
logId- the METS logical structure ID identifying a specific section within the record
-
getUrn
Getter for the fieldurn.- Returns:
- the URN identifying the bookmarked resource
-
setUrn
Setter for the fieldurn.- Parameters:
urn- the URN identifying the bookmarked resource
-
getName
Getter for the fieldname.- Returns:
- the display name for this bookmark entry
-
setName
Setter for the fieldname.- Parameters:
name- the display name for this bookmark entry
-
getDescription
Getter for the fielddescription.- Returns:
- an optional description or note for this bookmark entry
-
setDescription
Setter for the fielddescription.- Parameters:
description- an optional description or note for this bookmark entry
-
getDateAdded
Getter for the fielddateAdded.- Returns:
- the timestamp when this bookmark was added
-
setDateAdded
Setter for the fielddateAdded.- Parameters:
dateAdded- the timestamp when this bookmark was added
-
getOrder
Getter for the fieldorder.- Returns:
- the sort position of this bookmark within its list
-
setOrder
Setter for the fieldorder.- Parameters:
order- the sort position of this bookmark within its list
-
getMetadataElement
- Throws:
IndexUnreachableException
-
getSolrQueryForDocument
0.- Returns:
- Generated Solr query
-
getBrowseElement
-
isHasImages
public boolean isHasImages()
-