Package io.goobi.viewer.managedbeans
Class ContentBean
java.lang.Object
io.goobi.viewer.managedbeans.ContentBean
- All Implemented Interfaces:
Serializable
Supplies additional content for records (such contents produced by the crowdsourcing module).
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncleanUpValue(String value) Removes script tags from the given string.getCurrentUGCCoords.Getter for the fielduserGeneratedContentsForDisplay.booleanhasGeoCoordinateAnnotations(String persistentIdentifier) voidinit()init.static booleanisAccessible(DisplayUserGeneratedContent content, HttpServletRequest request) voidloadUserGeneratedContentsForDisplay(String pi, HttpServletRequest request) loadUserGeneratedContentsForDisplay.voidResets loaded content.
-
Constructor Details
-
ContentBean
public ContentBean()Empty Constructor.
-
-
Method Details
-
init
init. -
resetContentList
public void resetContentList()Resets loaded content. Use when logging in/out. -
getUserGeneratedContentsForDisplay
public List<DisplayUserGeneratedContent> getUserGeneratedContentsForDisplay(String pi) throws PresentationException, IndexUnreachableException, DAOException Getter for the fielduserGeneratedContentsForDisplay.- Parameters:
pi- Record identifier- Returns:
- User-generated contents for the given record identifier
- Throws:
PresentationException- if any.IndexUnreachableException- if any.DAOException
-
getUserGeneratedContentsOfPageForDisplay
public List<DisplayUserGeneratedContent> getUserGeneratedContentsOfPageForDisplay(PhysicalElement page) throws PresentationException, IndexUnreachableException, DAOException - Parameters:
page- physical page element to retrieve contents for- Returns:
- User-generated contents for the given page element
- Throws:
IndexUnreachableExceptionPresentationExceptionDAOException
-
loadUserGeneratedContentsForDisplay
public void loadUserGeneratedContentsForDisplay(String pi, HttpServletRequest request) throws PresentationException, IndexUnreachableException, DAOException loadUserGeneratedContentsForDisplay.- Parameters:
pi- Record identifierrequest- HTTP servlet request for access condition checks- Throws:
PresentationException- if any.IndexUnreachableException- if any.DAOException
-
isAccessible
- Parameters:
content- the user-generated content item to check access forrequest- HTTP servlet request for access condition checks- Returns:
- true if request has access rights to content; false otherwise
-
getCurrentUGCCoords
public List<List<String>> getCurrentUGCCoords(PhysicalElement page) throws IndexUnreachableException, PresentationException, DAOException getCurrentUGCCoords.- Parameters:
page- physical page whose UGC coordinates are retrieved- Returns:
- a list of coordinate string lists, one entry per user-generated content area on the given page
- Throws:
IndexUnreachableException- if any.PresentationException- if any.DAOException
-
cleanUpValue
Removes script tags from the given string.- Parameters:
value- raw string to strip JavaScript from- Returns:
- value sans any script tags
-
getEscapedBodyUrl
-
hasGeoCoordinateAnnotations
public boolean hasGeoCoordinateAnnotations(String persistentIdentifier) throws PresentationException, IndexUnreachableException, DAOException - Parameters:
persistentIdentifier- persistent identifier of the record to check- Returns:
- true if record with given identifier has any geo-location type annotations; false otherwise
- Throws:
IndexUnreachableExceptionPresentationExceptionDAOException
-