Package io.goobi.viewer.managedbeans
Class CmsRecordNotesBean
java.lang.Object
io.goobi.viewer.managedbeans.CmsRecordNotesBean
- All Implemented Interfaces:
Serializable
Bean used for listing and retrieving
CMSRecordNotes.- Author:
- Florian Alpers
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleandeleteNote(CMSRecordNote note) Get the thumbnail url for the record related to the note.getThumbnailUrl(CMSSingleRecordNote note, int width, int height) Get the thumbnail url for the record related to the note for given width and height.voidinit()booleanisArchiveNote(CMSRecordNote note) resolveNoteText(String text, String context) Prepares a note text for display: "page" resolves its variables for the page shown in the record view, "client" keeps them for the browser and any other context has no values for them.resolveNoteVariables(String text, String pageUrl, String imageUrl) Replaces {PAGE_URL} and {IMAGE_URL} in a note text.
-
Field Details
-
PI_TITLE_FILTER
- See Also:
-
-
Constructor Details
-
CmsRecordNotesBean
public CmsRecordNotesBean() -
CmsRecordNotesBean
- Parameters:
images- Bean used for image delivery
-
-
Method Details
-
init
-
getDataProvider
-
getThumbnailUrl
public String getThumbnailUrl(CMSSingleRecordNote note) throws IndexUnreachableException, PresentationException, ViewerConfigurationException Get the thumbnail url for the record related to the note.- Parameters:
note- Note whose related record's thumbnail is requested- Returns:
- Thumbnail URL
- Throws:
ViewerConfigurationExceptionPresentationExceptionIndexUnreachableException
-
getThumbnailUrl
public String getThumbnailUrl(CMSSingleRecordNote note, int width, int height) throws IndexUnreachableException, PresentationException, ViewerConfigurationException Get the thumbnail url for the record related to the note for given width and height.- Parameters:
note- Note whose related record's thumbnail is requestedwidth- Desired thumbnail width in pixelsheight- Desired thumbnail height in pixels- Returns:
- Thumbnail URL
- Throws:
ViewerConfigurationExceptionPresentationExceptionIndexUnreachableException
-
deleteNote
- Throws:
DAOException
-
getRecordUrl
public String getRecordUrl(CMSSingleRecordNote note) throws PresentationException, IndexUnreachableException - Parameters:
note- Note whose related record URL is requested- Returns:
- Record URL, or the archive URL for a note of an archive
- Throws:
IndexUnreachableExceptionPresentationException
-
isArchiveNote
- Parameters:
note- Note to check- Returns:
- true if the note belongs to an archive instead of a record
-
getArchiveImageUrl
- Parameters:
note- Note of an archive- Returns:
- URL of the tile image of the archive, or an empty string if it has none
- Throws:
DAOException
-
getNotesForRecord
- Throws:
DAOException
-
getSearchUrlForNote
-
resolveNoteText
Prepares a note text for display: "page" resolves its variables for the page shown in the record view, "client" keeps them for the browser and any other context has no values for them.- Parameters:
text- note text as HTMLcontext- variable context of the rendering view- Returns:
- the note text to display, or null if the note needs a variable value the context does not have
-
resolveNoteVariables
Replaces {PAGE_URL} and {IMAGE_URL} in a note text. In a link target, values after the query mark are URL-encoded. Text without variables is returned unchanged.- Parameters:
text- note text as HTMLpageUrl- URL of the current page; may be blankimageUrl- URL of the current image; may be blank- Returns:
- the note text with its variables resolved, or null if one of its variables has no value
-