Class PhysicalElement
- All Implemented Interfaces:
Serializable
,Comparable<PhysicalElement>
- See Also:
-
Nested Class Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
void
deleteCommentAction
(Comment comment) deleteCommentAction.protected static String
determineFileName
(String filePath) determineFileName.boolean
Getter for the fieldaccessConditions
.Getter for the fieldaltoFileName
.Getter for the fieldaltoText
.getAltoText
(boolean load) getComments.List of struct elements that start on this page.Getter for the fielddataRepository
.For images, this returns the full mime-type as image/X, with X being the format which should be used for image display.Getter for the fieldfileIdRoot
.Returns the fileName alone, ifio.goobi.viewer.model.viewer.PhysicalElement#getFilePath()
is a local file, or the entire filePath otherwisegetFileName
(String extension) Gets the filename but with its extension replaced by the given extension If the extension is an empty String, the filename without any extension is returned If the extension is null,getFileName()
is returnedgetFileNameBase.getFileNameExtension.getFileNameForFormat
(String format) getFileNameForFormat.Getter for the fieldfileNames
.getFilepath.long
Getter for the fieldfileSize
.getFileSizeAsString.Returns The first matching media filename for this pageint
getFooterHeight.int
getFooterHeight
(String pageType) getFooterHeight.static String
getFullMimeType
(String mimeType, String fileName) getFullMimeType.Getter for the fieldfullText
.Getter for the fieldfulltextFileName
.getId()
getId.int
Returns the actual image height, if available.getImageToPdfUrl.de.unigoettingen.sub.commons.contentlib.imagelib.ImageType
getImageType.getImageUrl.getImageUrl
(int size) getImageUrl.int
Returns the actual image width, if available.int
Return the zoom factor for this image depending on its actual size.getMediaUrl
(String format) Returns a "RESTful" URL for a media (audio or video) file in the given format.Getter for the fieldmimeType
.int
Return the bare width as read from the index (0 if none available).int
getOrder()
Getter for the fieldorder
.Getter for the fieldorderLabel
.getPageLinkLabel.int
getPhysicalImageHeight.int
getPhysicalImageWidth.getPi()
Getter for the fieldpi
.Getter for the fieldpurlPart
.getSandboxedUrl.getThumbnailUrl.getThumbnailUrl
(int width, int height) getThumbnailUrl.getUrl()
getUrl.getUrn()
Getter for the fieldurn
.int
getVideoHeight.int
getVideoWidth.getWatermarkText.getWordCoords
(Set<String> searchTerms) getWordCoords.getWordCoords
(Set<String> searchTerms, int proximitySearchDistance, int rotation) Returns word coordinates for words that start with any of the given search terms.Getter for the fieldwordCoordsFormat
.int
hashCode()
boolean
return true if this image has its own width/height measurements, and does not rely on default width/heightboolean
Checks if the media type is displayable as a 3d object and access is granted for viewing itboolean
isAccessPermissionBornDigital.boolean
boolean
Checks if the media type is displayable as an image and access is granted for viewing an imageboolean
boolean
checks if the user has the privilegeIPrivilegeHolder.PRIV_ZOOM_IMAGES
If the check fails andConfiguration.getUnzoomedImageAccessMaxWidth()
is greater than 0, false is returnedboolean
Remnant from when image access had to be checked for each tile.boolean
isAccessPermissionPdf.boolean
isAdaptImageViewHeight.boolean
isAltoAvailableForPage.boolean
boolean
isFulltextAvailableForPage.boolean
boolean
isDisplayPagePdfLink.boolean
boolean
boolean
isFulltextAvailable.boolean
boolean
isTeiAvailableForPage.loadAlto()
Loads ALTO data for this page via the REST service, if not yet loaded.void
setAccessConditions
(Set<String> accessConditions) Setter for the fieldaccessConditions
.void
setAltoFileName
(String altoFileName) Setter for the fieldaltoFileName
.void
setDoubleImage
(boolean doubleImage) void
setFileIdRoot
(String fileIdRoot) Setter for the fieldfileIdRoot
.void
setFileNames
(Map<String, String> fileNames) Setter for the fieldfileNames
.void
setFileSize
(long fileSize) Setter for the fieldfileSize
.void
setFlipRectoVerso
(boolean flipRectoVerso) void
setFullText
(String fullText) Setter for the fieldfullText
.void
setFulltextAvailable
(boolean fulltextAvailable) Setter for the fieldfulltextAvailable
.void
setFulltextFileName
(String fulltextFileName) Setter for the fieldfulltextFileName
.void
setHasImage
(boolean hasImage) void
setHeight
(int height) Setter for the fieldheight
.void
setMimeType
(String mimeType) Setter for the fieldmimeType
.void
setPurlPart
(String purlPart) Setter for the fieldpurlPart
.void
setWidth
(int width) Setter for the fieldwidth
.toString()
-
Field Details
-
WATERMARK_TEXT_TYPE_URN
ConstantWATERMARK_TEXT_TYPE_URN="URN"
- See Also:
-
WATERMARK_TEXT_TYPE_PURL
ConstantWATERMARK_TEXT_TYPE_PURL="PURL"
- See Also:
-
WATERMARK_TEXT_TYPE_SOLR
ConstantWATERMARK_TEXT_TYPE_SOLR="SOLR:"
- See Also:
-
-
Method Details
-
determineFileName
determineFileName.
-
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareTo
in interfaceComparable<PhysicalElement>
-
getUrl
getUrl.
- Returns:
- the url to the media content of the page, for example the
- Throws:
IndexUnreachableException
- if any.ViewerConfigurationException
- if any.
-
getSandboxedUrl
getSandboxedUrl.
- Returns:
- a
String
object.
-
getWatermarkText
getWatermarkText.
- Returns:
- a
String
object.
-
getThumbnailUrl
getThumbnailUrl.
- Returns:
String
- Throws:
ViewerConfigurationException
- if any.
-
getThumbnailUrl
getThumbnailUrl.
- Parameters:
width
- a int.height
- a int.- Returns:
- a
String
object.
-
getId
getId.
- Returns:
- a
String
object.
-
getFilepath
getFilepath.
- Returns:
String
Path zu Image Datei.
-
getOrder
public int getOrder()Getter for the field
order
.- Returns:
- a int.
-
getOrderLabel
Getter for the field
orderLabel
.- Returns:
- a
String
object.
-
getUrn
Getter for the field
urn
.- Returns:
- the urn
-
setPurlPart
Setter for the field
purlPart
.- Parameters:
purlPart
- the purlPart to set
-
getPurlPart
Getter for the field
purlPart
.- Returns:
- the purlPart
-
getDisplayMimeType
For images, this returns the full mime-type as image/X, with X being the format which should be used for image display. This is png for png-images and jpeg for all other types.- Returns:
- a
String
object.
-
getFullMimeType
getFullMimeType.
-
getBaseMimeType
- Returns:
- First part of the mime type
-
getMimeType
Getter for the field
mimeType
.- Returns:
- the mimeType
-
setMimeType
Setter for the field
mimeType
.- Parameters:
mimeType
- the mimeType to set
-
setWidth
public void setWidth(int width) Setter for the field
width
.- Parameters:
width
- the width to set
-
setHeight
public void setHeight(int height) Setter for the field
height
.- Parameters:
height
- the height to set
-
getFileIdRoot
Getter for the field
fileIdRoot
.- Returns:
- the fileIdRoot
-
setFileIdRoot
Setter for the field
fileIdRoot
.- Parameters:
fileIdRoot
- the fileIdRoot to set
-
isDisplayImage
- Returns:
- true if page has an indexed image file name and user has access permission; false otherwise
- Throws:
DAOException
IndexUnreachableException
-
isHasImage
public boolean isHasImage()- Returns:
- the hasImage
-
setHasImage
public void setHasImage(boolean hasImage) - Parameters:
hasImage
- the hasImage to set
-
isDoubleImage
public boolean isDoubleImage()- Returns:
- the doubleImage
-
setDoubleImage
public void setDoubleImage(boolean doubleImage) - Parameters:
doubleImage
- the doubleImage to set
-
isFlipRectoVerso
public boolean isFlipRectoVerso()- Returns:
- the flipRectoVerso
-
setFlipRectoVerso
public void setFlipRectoVerso(boolean flipRectoVerso) - Parameters:
flipRectoVerso
- the flipRectoVerso to set
-
isDisplayFulltext
isFulltextAvailableForPage.
- Returns:
- a boolean.
- Throws:
IndexUnreachableException
- if any.DAOException
- if any.
-
isFulltextAvailable
public boolean isFulltextAvailable()isFulltextAvailable.
- Returns:
- the fulltextAvailable
-
isFulltextAccessPermission
- Returns:
- the fulltextAccessPermission
- Throws:
ViewerConfigurationException
-
setFulltextAvailable
public void setFulltextAvailable(boolean fulltextAvailable) Setter for the field
fulltextAvailable
.- Parameters:
fulltextAvailable
- the fulltextAvailable to set
-
isAltoAvailable
public boolean isAltoAvailable()isAltoAvailableForPage.
- Returns:
- a boolean.
- Throws:
IndexUnreachableException
- if any.DAOException
- if any.
-
isTeiAvailable
isTeiAvailableForPage.
- Returns:
- a boolean.
- Throws:
IndexUnreachableException
- if any.DAOException
- if any.
-
getFulltextFileName
Getter for the field
fulltextFileName
.- Returns:
- the fulltextFileName
-
setFulltextFileName
Setter for the field
fulltextFileName
.- Parameters:
fulltextFileName
- the fulltextFileName to set
-
getAltoFileName
Getter for the field
altoFileName
.- Returns:
- the altoFileName
-
setAltoFileName
Setter for the field
altoFileName
.- Parameters:
altoFileName
- the altoFileName to set
-
getFullText
Getter for the field
fullText
.- Returns:
- the fullText
- Throws:
ViewerConfigurationException
- if any.
-
getFulltextMimeType
- Returns:
- The probable mimeType of the fulltext. If the fulltext is not yet loaded, it is loaded first
- Throws:
ViewerConfigurationException
-
setFullText
Setter for the field
fullText
.- Parameters:
fullText
- the fullText to set
-
getWordCoords
getWordCoords.
- Parameters:
searchTerms
- aSet
object.- Returns:
- a
List
object. - Throws:
ViewerConfigurationException
- if any.
-
getWordCoords
public List<String> getWordCoords(Set<String> searchTerms, int proximitySearchDistance, int rotation) throws ViewerConfigurationException Returns word coordinates for words that start with any of the given search terms.- Parameters:
searchTerms
- aSet
object.proximitySearchDistance
-rotation
- a int.- Returns:
- a
List
object. - Throws:
ViewerConfigurationException
- if any.
-
loadAlto
public StringPair loadAlto() throws AccessDeniedException, org.jdom2.JDOMException, IOException, IndexUnreachableException, DAOException, ViewerConfigurationExceptionLoads ALTO data for this page via the REST service, if not yet loaded.- Returns:
- StringPair(ALTO,charset)
- Throws:
AccessDeniedException
- if any.org.jdom2.JDOMException
- if any.IOException
- if any.IndexUnreachableException
- if any.DAOException
- if any.ViewerConfigurationException
- if any.
-
getFileNames
Getter for the field
fileNames
.- Returns:
- the fileNames
-
setFileNames
Setter for the field
fileNames
.- Parameters:
fileNames
- the fileNames to set
-
getFirstFileName
Returns The first matching media filename for this page- Returns:
- The first matching media filename for this page
-
getFileName
Returns the fileName alone, ifio.goobi.viewer.model.viewer.PhysicalElement#getFilePath()
is a local file, or the entire filePath otherwise- Returns:
- a
String
object.
-
getFileNameBase
getFileNameBase.
- Returns:
- a
String
object.
-
getFileNameExtension
getFileNameExtension.
- Returns:
- a
String
object.
-
getFileNameForFormat
getFileNameForFormat.
-
getImageToPdfUrl
getImageToPdfUrl.
- Returns:
- a
String
object. - Throws:
IndexUnreachableException
- if any.
-
getMediaUrl
Returns a "RESTful" URL for a media (audio or video) file in the given format.- Parameters:
format
- aString
object.- Returns:
- a
String
object. - Throws:
IndexUnreachableException
- if any.
-
getVideoWidth
public int getVideoWidth()getVideoWidth.
- Returns:
- a int.
-
getVideoHeight
public int getVideoHeight()getVideoHeight.
- Returns:
- a int.
-
getImageWidth
public int getImageWidth()Returns the actual image width, if available. Otherwise the default width.- Returns:
- a int.
-
getImageHeight
public int getImageHeight()Returns the actual image height, if available. Otherwise the default height.- Returns:
- a int.
-
getPhysicalImageHeight
public int getPhysicalImageHeight()getPhysicalImageHeight.
- Returns:
- a int.
-
getImageZoomFactor
public int getImageZoomFactor()Return the zoom factor for this image depending on its actual size.- Returns:
- a int.
-
getImageUrl
getImageUrl.
- Returns:
- a
String
object.
-
getImageUrl
getImageUrl.
- Parameters:
size
- a int.- Returns:
- a
String
object.
-
getMixWidth
public int getMixWidth()Return the bare width as read from the index (0 if none available).- Returns:
- a int.
-
getPhysicalImageWidth
public int getPhysicalImageWidth()getPhysicalImageWidth.
- Returns:
- a int.
-
getPi
Getter for the field
pi
.- Returns:
- the pi
-
getAccessConditions
Getter for the field
accessConditions
.- Returns:
- the accessConditions
-
setAccessConditions
Setter for the field
accessConditions
.- Parameters:
accessConditions
- the accessConditions to set
-
getPageLinkLabel
getPageLinkLabel.
- Returns:
- a
String
object.
-
isAccessPermission3DObject
Checks if the media type is displayable as a 3d object and access is granted for viewing it- Returns:
- a boolean.
- Throws:
IndexUnreachableException
- if any.DAOException
- if any.
-
isAccessPermissionImage
Checks if the media type is displayable as an image and access is granted for viewing an image- Returns:
- a boolean.
- Throws:
IndexUnreachableException
- if any.DAOException
- if any.
-
isAccessPermissionObject
Remnant from when image access had to be checked for each tile. Still used for OpenSeaDragon, so it just redirects to the access permission check.- Returns:
- a boolean.
- Throws:
IndexUnreachableException
- if any.DAOException
- if any.
-
isAccessPermissionImageZoom
checks if the user has the privilegeIPrivilegeHolder.PRIV_ZOOM_IMAGES
If the check fails andConfiguration.getUnzoomedImageAccessMaxWidth()
is greater than 0, false is returned- Returns:
- true exactly if the user is allowed to zoom images. false otherwise
- Throws:
IndexUnreachableException
DAOException
-
isAccessPermissionImageDownload
- Returns:
- true if user has access permission; false otherwise
- Throws:
IndexUnreachableException
DAOException
-
isAccessPermissionPdf
public boolean isAccessPermissionPdf()isAccessPermissionPdf.
- Returns:
- true if PDF download is allowed for this page; false otherwise
-
isAccessPermissionBornDigital
isAccessPermissionBornDigital.
- Returns:
- true if access is allowed for born digital files; false otherwise
- Throws:
IndexUnreachableException
- if any.DAOException
- if any.
-
isBornDigitalDownloadTicketRequired
- Returns:
- true if a download ticket requirement is present and not yet satisfied; false otherwise
- Throws:
IndexUnreachableException
DAOException
-
isAccessPermissionFulltext
- Returns:
- true if user has access permission; false otherwise
- Throws:
IndexUnreachableException
DAOException
-
getComments
getComments.
- Returns:
- a
List
object. - Throws:
DAOException
- if any.
-
deleteCommentAction
deleteCommentAction.
- Parameters:
comment
- aComment
object.- Throws:
DAOException
- if any.
-
hasIndividualSize
public boolean hasIndividualSize()return true if this image has its own width/height measurements, and does not rely on default width/height- Returns:
- a boolean.
-
getAltoText
Getter for the field
altoText
.- Returns:
- the altoText
-
getAltoText
- Parameters:
load
- If true, ALTO will be loaded if altoText is null- Returns:
- ALTO document for this page
- Throws:
ViewerConfigurationException
-
getAltoCharset
- Returns:
- the altoCharset
-
getWordCoordsFormat
Getter for the field
wordCoordsFormat
.- Returns:
- the wordCoordsFormat
-
getDataRepository
Getter for the field
dataRepository
.- Returns:
- the dataRepository
-
getFileSize
public long getFileSize()Getter for the field
fileSize
.- Returns:
- the fileSize
-
setFileSize
public void setFileSize(long fileSize) Setter for the field
fileSize
.- Parameters:
fileSize
- the fileSize to set
-
getFileSizeAsString
getFileSizeAsString.
- Returns:
- a
String
object.
-
getImageType
public de.unigoettingen.sub.commons.contentlib.imagelib.ImageType getImageType()getImageType.
- Returns:
- a
ImageType
object.
-
getFileName
Gets the filename but with its extension replaced by the given extension If the extension is an empty String, the filename without any extension is returned If the extension is null,getFileName()
is returned -
isDisplayPagePdfLink
public boolean isDisplayPagePdfLink()isDisplayPagePdfLink.
- Returns:
- true if page pdf link is allowed in configuration and no access conditions prevent PDF download; false otherwise
-
isAdaptImageViewHeight
public boolean isAdaptImageViewHeight()isAdaptImageViewHeight.
- Returns:
- false if
Configuration.isLimitImageHeight()
returns true and the image side ratio (width/height) is below the lower or above the upper threshold Otherwise return true
-
getContainedStructElements
public List<StructElement> getContainedStructElements() throws PresentationException, IndexUnreachableExceptionList of struct elements that start on this page. For example, if a page contains multiple elements that only cover a certain area of the page (using coordinates), this method can be used to get all shape coordinates for these elemets for visualization.- Returns:
- List of
/StructElement
s
- Throws:
IndexUnreachableException
PresentationException
-
getContainedStructElementsAsJson
public String getContainedStructElementsAsJson() throws PresentationException, IndexUnreachableException, com.fasterxml.jackson.core.JsonProcessingException- Returns:
String
- Throws:
PresentationException
IndexUnreachableException
com.fasterxml.jackson.core.JsonProcessingException
-
toString
-