Package io.goobi.viewer.model.search
Class BrowseElement
java.lang.Object
io.goobi.viewer.model.search.BrowseElement
- All Implemented Interfaces:
IAccessDeniedThumbnailOutput,Serializable
Representation of a search hit.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionde.intranda.metadata.multilanguage.IMetadataValuecreateMultiLanguageLabel(StructElement structElement) createMultiLanguageLabel.determinePageType.getAccessDeniedThumbnailUrl(Locale locale) Returns the lowestStructElementStubin the list.Returns the ContextObject value for a COinS element using the docstruct hierarchy for this search hit.Getter for the fielddataRepository.Getter for the fielddocStructType.Getter for the fielddocType.getFirstMetadataValue(String field) Getter for the fieldfoundMetadataList.Getter for the fieldfulltext.Returns a relevant full-text fragment for displaying in the search hit box, stripped of any contained JavaScript.getIddoc()Getter for the fieldiddoc.intGetter for the fieldimageNo.getLabel()Getter for the fieldlabel.Getter for the fieldlabel.de.intranda.metadata.multilanguage.IMetadataValuegetLabelAsMetadataValue.Getter for the fieldlabelShort.getLogId()Getter for the fieldlogId.Getter for the fieldmetadataGroupType.Getter for the fieldmetadataList.getMetadataList(String metadataLabel) Getter for the fieldmetadataList.getMetadataListForCurrentLocale.getMetadataListForLocale(String field, Locale locale) getMetadataListForLocale(String field, Locale locale, String metadataListType) getMetadataListForLocale(Locale locale) getMetadataListForLocale.getMetadataListForLocale(Locale locale, String metadataListType) getMetadataValues(String field) longGetter for the fieldnumVolumes.Getter for the fieldoriginalFieldName.getPi()Getter for the fieldpi.Getter for the fieldrecordLanguages.Getter for the fieldsidebarNextUrl.Getter for the fieldsidebarPrevUrl.Getter for the fieldstructElements.Getter for the fieldthumbnailUrl.getThumbnailUrl(String width, String height) Called from HTML.getUrl()Returns the search hint URL (without the application root!).Getter for the fieldvolumeNo.booleanisAnchor()isAnchor.booleanbooleanbooleanChecks whether the search hit should identify itself as a group document when being displayed.booleanisGroup()booleanisHasImages.booleanisHasMedia.booleanbooleanbooleanisWork()voidsetAccessPermissionThumbnail(AccessPermission accessPermissionThumbnail) voidsetAnchor(boolean anchor) Setter for the fieldanchor.voidsetCmsPage(boolean cmsPage) voidsetFulltext(String fulltext) Setter for the fieldfulltext.voidsetHasImages(boolean hasImages) Setter for the fieldhasImages.voidsetHasMedia(boolean hasMedia) Setter for the fieldhasMedia.voidsetHasTeiFiles(boolean hasTeiFiles) voidsetImageNo(int imageNo) voidsetLabelShort(de.intranda.metadata.multilanguage.IMetadataValue labelShort) Setter for the fieldlabelShort.voidvoidSetter for the fieldpi.voidsetThumbnailUrl(String thumbnailUrl) voidsetVolumeNo(String volumeNo) Setter for the fieldvolumeNo.voidsetWork(boolean work)
-
Constructor Details
-
BrowseElement
public BrowseElement(String pi, int imageNo, String label, String fulltext, Locale locale, String dataRepository, String url) Creates a new unit tests and special instances instance.- Parameters:
pi- persistent identifier of the recordimageNo- representative image page numberlabel- display label for the elementfulltext- full-text content for the elementlocale- locale for translationsdataRepository- data repository name for the recordurl- Injected URL, overrides URL generation
-
-
Method Details
-
createMultiLanguageLabel
public de.intranda.metadata.multilanguage.IMetadataValue createMultiLanguageLabel(StructElement structElement) createMultiLanguageLabel.- Parameters:
structElement- structure element to generate the label from- Returns:
- the multilingual label derived from the structure element's metadata fields
-
getLabel
Getter for the fieldlabel.- Returns:
- the translated label for the current locale, falling back to the default value or an empty string
-
getLabel
Getter for the fieldlabel.- Parameters:
locale- locale used to select the translated label- Returns:
- the display label for this search result in the given locale
-
getLabelAsMetadataValue
public de.intranda.metadata.multilanguage.IMetadataValue getLabelAsMetadataValue()getLabelAsMetadataValue.- Returns:
- the multilingual label of this browse element
-
getLabelShort
Getter for the fieldlabelShort.- Returns:
- the abbreviated label for the current locale, falling back to the default value or an empty string
-
setLabelShort
public void setLabelShort(de.intranda.metadata.multilanguage.IMetadataValue labelShort) Setter for the fieldlabelShort.- Parameters:
labelShort- the abbreviated label value to display in compact search result views
-
getDocStructType
Getter for the fielddocStructType.- Returns:
- the document structure type identifier (e.g. "monograph", "chapter") for this browse element
-
getIddoc
Getter for the fieldiddoc.- Returns:
- the internal Solr document ID for this browse element
-
getThumbnailUrl
Getter for the fieldthumbnailUrl.- Returns:
- the URL of the thumbnail image for this browse element
-
getThumbnailUrl
Called from HTML.- Parameters:
width- desired thumbnail width in pixelsheight- desired thumbnail height in pixels- Returns:
- the thumbnail URL for this search result scaled to the given dimensions
-
getAccessDeniedThumbnailUrl
- Specified by:
getAccessDeniedThumbnailUrlin interfaceIAccessDeniedThumbnailOutput- Parameters:
locale- locale for selecting the appropriate image- Returns:
- Configured image URI for the given language; null if none found
-
getImageNo
public int getImageNo()Getter for the fieldimageNo.- Returns:
- a int.
-
setImageNo
public void setImageNo(int imageNo) -
getStructElements
Getter for the fieldstructElements.- Returns:
- the list of structure element stubs from the record hierarchy (outermost first)
-
getBottomStructElement
Returns the lowestStructElementStubin the list.- Returns:
- last StructElementStub in the list
-
getEvents
-
setFulltext
Setter for the fieldfulltext.- Parameters:
fulltext- the full-text content associated with this browse element
-
getFulltext
Getter for the fieldfulltext.- Returns:
- the full-text content associated with this browse element
-
getFulltextForHtml
Returns a relevant full-text fragment for displaying in the search hit box, stripped of any contained JavaScript.- Returns:
- Full-text fragment sans any line breaks or JavaScript
-
getVolumeNo
Getter for the fieldvolumeNo.- Returns:
- the volume number string for this browse element
-
setVolumeNo
Setter for the fieldvolumeNo.- Parameters:
volumeNo- the volume number string for this browse element
-
isDisplayGroupStatus
public boolean isDisplayGroupStatus()Checks whether the search hit should identify itself as a group document when being displayed.- Returns:
- true if group and not newspaper; false otherwise
-
isGroup
public boolean isGroup()- Returns:
- true if doctype is GROUP; false otherwise
-
isArchive
public boolean isArchive()- Returns:
- true if doctype is ARCHIVE; false otherwise
-
isCmsPage
public boolean isCmsPage() -
setCmsPage
public void setCmsPage(boolean cmsPage) -
isWork
public boolean isWork() -
setWork
public void setWork(boolean work) -
isAnchor
public boolean isAnchor()isAnchor.- Returns:
- true if this element represents an anchor document, false otherwise
-
setAnchor
public void setAnchor(boolean anchor) Setter for the fieldanchor.- Parameters:
anchor- true if this element represents an anchor document; false otherwise
-
isHasImages
public boolean isHasImages()isHasImages.- Returns:
- true if this element has associated image content, false otherwise
-
setHasImages
public void setHasImages(boolean hasImages) Setter for the fieldhasImages.- Parameters:
hasImages- true if this element has associated image content; false otherwise
-
isHasTeiFiles
public boolean isHasTeiFiles() -
setHasTeiFiles
public void setHasTeiFiles(boolean hasTeiFiles) -
isShowThumbnail
public boolean isShowThumbnail()- Returns:
- true if either criterion for thumbnail display is fulfilled; false otherwise
-
getNumVolumes
public long getNumVolumes()Getter for the fieldnumVolumes.- Returns:
- the number of volumes contained in this anchor record
-
setPi
Setter for the fieldpi.- Parameters:
pi- the persistent identifier of the record associated with this browse element
-
getPi
Getter for the fieldpi.- Returns:
- the persistent identifier of the record associated with this browse element
-
getUrl
Returns the search hint URL (without the application root!).- Returns:
- the relative URL for this browse element's detail page
-
getSidebarPrevUrl
Getter for the fieldsidebarPrevUrl.- Returns:
- the URL for navigating to the previous search hit in the sidebar
-
getSidebarNextUrl
Getter for the fieldsidebarNextUrl.- Returns:
- the URL for navigating to the next search hit in the sidebar
-
getRisExport
-
getMetadataFieldNames
- Returns:
- List of field names in the metadata list
-
getMetadataList
Getter for the fieldmetadataList.- Returns:
- a list of metadata entries configured for the search hit display
-
getMetadataValues
-
getFirstMetadataValue
-
getMetadataListForLocale
- Parameters:
field- metadata field name to filter bylocale- locale for language-specific filtering- Returns:
- List
-
getMetadataListForLocale
public List<Metadata> getMetadataListForLocale(String field, Locale locale, String metadataListType) - Parameters:
field- Requested field namelocale- Requested localemetadataListType- key of the metadata list to query (e.g. search hit or secondary)- Returns:
- List
-
getMetadataListForLocale
getMetadataListForLocale.- Parameters:
locale- locale used to filter language-specific metadata- Returns:
- a list of metadata entries for the search hit display filtered to the given locale
-
getMetadataListForLocale
- Parameters:
locale- locale for language-specific filteringmetadataListType- key of the metadata list to query (e.g. search hit or secondary)- Returns:
- List
-
getMetadataListForCurrentLocale
getMetadataListForCurrentLocale.- Returns:
- a list of metadata entries for the search hit display filtered to the current request locale
-
getSecondaryMetadataListForCurrentLocale
- Returns:
- First metadata list in metadataListMap that's not the default search metadata list configuration; empty list if not found
-
getExistingMetadataFields
-
getMetadataGroupType
Getter for the fieldmetadataGroupType.- Returns:
- the metadata group type classifying the kind of grouped metadata this element represents
-
getMetadataList
Getter for the fieldmetadataList.- Parameters:
metadataLabel- label key to filter metadata entries by- Returns:
- a list of metadata entries from the search hit list whose label matches the given key
-
getFoundMetadataList
Getter for the fieldfoundMetadataList.- Returns:
- the list of metadata entries that matched the search query
-
getDataRepository
Getter for the fielddataRepository.- Returns:
- the name of the data repository storing the content files for this record
-
getAccessPermissionThumbnail
-
setAccessPermissionThumbnail
-
getContextObject
Returns the ContextObject value for a COinS element using the docstruct hierarchy for this search hit.- Returns:
- the COinS context object string for embedding bibliographic metadata in a <span> element
-
getRecordLanguages
Getter for the fieldrecordLanguages.- Returns:
- the list of language codes in which the record content is available
-
setHasMedia
public void setHasMedia(boolean hasMedia) Setter for the fieldhasMedia.- Parameters:
hasMedia- true if this element has associated non-image media content; false otherwise
-
isHasMedia
public boolean isHasMedia()isHasMedia.- Returns:
- true if this element has associated non-image media content, false otherwise
-
getOriginalFieldName
Getter for the fieldoriginalFieldName.- Returns:
- the original Solr field name from which this browse element's label was derived
-
determinePageType
determinePageType.- Returns:
- the PageType appropriate for this browse element based on its document structure and MIME type
-
getLogId
Getter for the fieldlogId.- Returns:
- the logical structure element ID (LOG_ID) of the record associated with this browse element
-
setLogId
-
getDocType
Getter for the fielddocType.- Returns:
- the document type of this browse element (e.g. DOCSTRCT, UGC, CMS)
-
setThumbnailUrl
-