java.lang.Object
io.goobi.viewer.model.crowdsourcing.questions.Question
All Implemented Interfaces:
Serializable

@Entity public class Question extends Object implements Serializable
An annotation generator to create a specific type of annotation for a specific question. One or more of these may be contained within a Campaign
Author:
florian
See Also:
  • Constructor Details

    • Question

      public Question()
      Empty constructor.
    • Question

      public Question(Campaign owner)
      constructor setting the owning campaign
      Parameters:
      owner - a Campaign object.
    • Question

      public Question(QuestionType questionType, TargetSelector targetSelector, int targetFrequency, Campaign owner)
      constructor setting the owning campaign as well ass the type of annotation to be generated
      Parameters:
      questionType - a QuestionType object.
      targetSelector - a TargetSelector object.
      targetFrequency - a int.
      owner - a Campaign object.
    • Question

      public Question(Question orig)
      Parameters:
      orig -
    • Question

      public Question(Question orig, Campaign campaign)
      Create a clone of the given question with the given campaign as owner
      Parameters:
      orig -
      campaign -
  • Method Details

    • serializeMetadataFields

      public void serializeMetadataFields()
      Call when metadata list changes
    • getAvailableQuestionTypes

      public List<QuestionType> getAvailableQuestionTypes()

      getAvailableQuestionTypes.

      Returns:
      available values of the QuestionType enum
    • getAvailableTargetSelectors

      public List<TargetSelector> getAvailableTargetSelectors()

      getAvailableTargetSelectors.

      Returns:
      available values of the TargetSelector enum
    • getId

      public Long getId()

      Getter for the field id.

      Returns:
      the id
    • setId

      public void setId(Long id)

      Setter for the field id.

      Parameters:
      id - the id to set
    • getOwner

      public Campaign getOwner()

      Getter for the field owner.

      Returns:
      the owner
    • setOwner

      public void setOwner(Campaign owner)

      Setter for the field owner.

      Parameters:
      owner - the owner to set
    • getText

      public TranslatedText getText()
      Returns:
      the tempTranslations
    • getQuestionType

      public QuestionType getQuestionType()

      Getter for the field questionType.

      Returns:
      the questionType
    • setQuestionType

      public void setQuestionType(QuestionType questionType)

      Setter for the field questionType.

      Parameters:
      questionType - the questionType to set
    • getTargetSelector

      public TargetSelector getTargetSelector()

      Getter for the field targetSelector.

      Returns:
      the targetSelector
    • setTargetSelector

      public void setTargetSelector(TargetSelector targetSelector)

      Setter for the field targetSelector.

      Parameters:
      targetSelector - the targetSelector to set
    • getTargetFrequency

      public int getTargetFrequency()

      Getter for the field targetFrequency.

      Returns:
      the targetFrequency
    • getMetadataFields

      public List<String> getMetadataFields()
      Returns:
      the metadataFields
    • setMetadataFields

      public void setMetadataFields(List<String> metadataFields)
      Parameters:
      metadataFields - the metadataFields to set
    • addMetadataField

      public void addMetadataField(String field)
    • removeMetadataField

      public void removeMetadataField(String field)
    • setMetadataToAdd

      public void setMetadataToAdd(String metadataToAdd)
      Parameters:
      metadataToAdd - the metadataToAdd to set
    • getMetadataToAdd

      public String getMetadataToAdd()
      Returns:
      the metadataToAdd
    • getAvailableMetadataFields

      public List<String> getAvailableMetadataFields() throws IndexUnreachableException
      Returns:
      a list of all "MD_" fields from solr
      Throws:
      IOException
      org.apache.solr.client.solrj.SolrServerException
      IndexUnreachableException
    • setTargetFrequency

      public void setTargetFrequency(int targetFrequency)

      Setter for the field targetFrequency.

      Parameters:
      targetFrequency - the targetFrequency to set
    • getQuestionId

      public static Long getQuestionId(URI idAsURI)
      get the id of a question from an URI identifier
      Parameters:
      idAsURI - a URI object.
      Returns:
      a Long object.
    • getCampaignId

      public static Long getCampaignId(URI idAsURI)
      get the Campaign.id of the owning campaign from an URI identifier of a question
      Parameters:
      idAsURI - a URI object.
      Returns:
      a Long object.
    • getIdAsURI

      public URI getIdAsURI()

      getIdAsURI.

      Returns:
      The URI identifier for this question from the question and campaign id
    • getAuthorityData

      public NormdataAuthority getAuthorityData()
      Currently only returns GND authority data.
      Returns:
      Normdata authority data if the question type is NORMDATA, otherwise null
    • getMetadataFieldSelection

      public Map<String,Boolean> getMetadataFieldSelection()
      Returns:
      the metadataFieldSelection
      Throws:
      IOException
      org.apache.solr.client.solrj.SolrServerException
    • getSelectedMetadataFields

      public List<String> getSelectedMetadataFields()