Class DisplayUserGeneratedContent

java.lang.Object
io.goobi.viewer.model.crowdsourcing.DisplayUserGeneratedContent

public class DisplayUserGeneratedContent extends Object
UserGeneratedContent stub class for displaying contents generated by the crowdsourcing module.
  • Field Details

    • FORMAT

      public static final NumberFormat FORMAT
      Constant format
  • Constructor Details

    • DisplayUserGeneratedContent

      public DisplayUserGeneratedContent()
      Default constructor (needed for persistence).
    • DisplayUserGeneratedContent

      public DisplayUserGeneratedContent(PersistentAnnotation a)
  • Method Details

    • getId

      public Long getId()

      Getter for the field id.

      Returns:
      a Long object.
    • setId

      public void setId(Long id)

      Setter for the field id.

      Parameters:
      id - a Long object.
    • getType

      Getter for the field type.

      Returns:
      the type
    • setType

      public void setType(DisplayUserGeneratedContent.ContentType type)

      Setter for the field type.

      Parameters:
      type - the type to set
    • getPi

      public String getPi()

      Getter for the field pi.

      Returns:
      the pi
    • setPi

      public void setPi(String pi)

      Setter for the field pi.

      Parameters:
      pi - the pi to set
    • getPage

      public Integer getPage()

      Getter for the field page.

      Returns:
      the page
    • setPage

      public void setPage(Integer page)

      Setter for the field page.

      Parameters:
      page - the page to set
    • getLabel

      public String getLabel()

      Getter for the field label.

      Returns:
      the label
    • setLabel

      public void setLabel(String label)

      Setter for the field label.

      Parameters:
      label - the label to set
    • getDisplayLabel

      public String getDisplayLabel()
      Returns the label, if set, otherwise pi.
      Returns:
      a String object.
    • getExtendendLabel

      public String getExtendendLabel()
      Returns:
      the extendendLabel
    • setExtendendLabel

      public void setExtendendLabel(String extendendLabel)
      Parameters:
      extendendLabel - the extendendLabel to set
    • getUpdatedBy

      public User getUpdatedBy()

      Getter for the field updatedBy.

      Returns:
      the updatedBy
    • setUpdatedBy

      public void setUpdatedBy(User updatedBy)

      Setter for the field updatedBy.

      Parameters:
      updatedBy - the updatedBy to set
    • getDateUpdated

      public LocalDateTime getDateUpdated()

      Getter for the field dateUpdated.

      Returns:
      the dateUpdated
    • getDateUpdatedAsString

      public String getDateUpdatedAsString()

      getDateUpdatedAsString.

      Returns:
      a String object.
    • getTimeUpdatedAsString

      public String getTimeUpdatedAsString()

      getTimeUpdatedAsString.

      Returns:
      a String object.
    • setDateUpdated

      public void setDateUpdated(LocalDateTime dateUpdated)

      Setter for the field dateUpdated.

      Parameters:
      dateUpdated - the dateUpdated to set
    • getAccessCondition

      public String getAccessCondition()
      Returns:
      the accessCondition
    • setAccessCondition

      public void setAccessCondition(String accessCondition)
      Parameters:
      accessCondition - the accessCondition to set
    • getAreaString

      public String getAreaString()

      Getter for the field areaString.

      Returns:
      the areaString
    • setAreaString

      public void setAreaString(String areaString)

      Setter for the field areaString.

      Parameters:
      areaString - the areaString to set
    • hasArea

      public boolean hasArea()

      hasArea.

      Returns:
      a boolean.
    • mayHaveArea

      public boolean mayHaveArea()

      mayHaveArea.

      Returns:
      a boolean.
    • convertToIntArray

      public static int[] convertToIntArray(double[] coordinates)

      convertToIntArray.

      Parameters:
      coordinates - int[]
      Returns:
      int[]
    • convertToDoubleArray

      public static double[] convertToDoubleArray(int[] coordinates)

      convertToDoubleArray.

      Parameters:
      coordinates - int[]
      Returns:
      double[]
    • getDisplayCoordinates

      public String getDisplayCoordinates()

      Getter for the field displayCoordinates.

      Returns:
      a String object.
    • setDisplayCoordinates

      public void setDisplayCoordinates(String displayCoordinates)

      Setter for the field displayCoordinates.

      Parameters:
      displayCoordinates - a String object.
    • getDisplayPage

      public Integer getDisplayPage()
      Alias for getPage()
      Returns:
      a Integer object.
    • isEmpty

      public boolean isEmpty()
      Check if the resource has either a label or an annotation body with a type
      Returns:
      true if neither label nor annotation body exist
    • getTypeAsString

      public String getTypeAsString()

      getTypeAsString.

      Returns:
      a String object.
    • getAnnotationBody

      public de.intranda.api.annotation.ITypedResource getAnnotationBody()
      Returns:
      the annotationBody
    • setAnnotationBody

      public void setAnnotationBody(de.intranda.api.annotation.ITypedResource annotationBody)
      Parameters:
      annotationBody - the annotationBody to set
    • setAnnotationBody

      public boolean setAnnotationBody(String json)
    • createJsonFromFeatures

      public static String createJsonFromFeatures(Object value)
    • buildFromSolrDoc

      public static DisplayUserGeneratedContent buildFromSolrDoc(org.apache.solr.common.SolrDocument doc) throws IndexUnreachableException

      buildFromSolrDoc.

      Parameters:
      doc - a SolrDocument object.
      Returns:
      UserGeneratedContent generated from the given Solr document
      Throws:
      IndexUnreachableException - if any.
    • generateUgcLabel

      public static String generateUgcLabel(StructElement se)
      Builds label out of user-generated content metadata.
      Parameters:
      se - a StructElement object.
      Returns:
      the generated label
    • generateAddressLabel

      public static String generateAddressLabel(StructElement se, String text)
      Parameters:
      se -
      text -
      Returns:
      String
    • generateCorporationLabel

      public static String generateCorporationLabel(StructElement se)
      Parameters:
      se -
      Returns:
      String
    • generatePersonLabel

      public static String generatePersonLabel(StructElement se)
    • isOnThisPage

      public boolean isOnThisPage(PhysicalElement page)
    • isOnOtherPage

      public boolean isOnOtherPage(PhysicalElement page)
    • isOnAnyPage

      public boolean isOnAnyPage()
    • getIconClass

      public String getIconClass()
    • getPageUrl

      public String getPageUrl()
    • getPageUrl

      public String getPageUrl(PageType pageType)
      Parameters:
      pageType -
      Returns:
      Generated URL
    • isCrowdsourcingModuleContent

      public boolean isCrowdsourcingModuleContent()
    • setCrowdsourcingModuleContent

      public void setCrowdsourcingModuleContent(boolean crowdsourcingModuleContent)