Class Question
java.lang.Object
io.goobi.viewer.model.crowdsourcing.questions.Question
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionQuestion()Empty constructor.constructor setting the owning campaignCreate a clone of the given question with the given campaign as ownerQuestion(QuestionType questionType, TargetSelector targetSelector, int targetFrequency, Campaign owner) constructor setting the owning campaign as well ass the type of annotation to be generated -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMetadataField(String field) Currently only returns GND authority data.getAvailableQuestionTypes.getAvailableTargetSelectors.static LonggetCampaignId(URI idAsURI) get theCampaign.idof the owning campaign from an URI identifier of a questiongetId()Getter for the fieldid.getIdAsURI.getOwner()Getter for the fieldowner.static LonggetQuestionId(URI idAsURI) get theidof a question from an URI identifierGetter for the fieldquestionType.intGetter for the fieldtargetFrequency.Getter for the fieldtargetSelector.getText()voidremoveMetadataField(String field) voidCall when metadata list changesvoidSetter for the fieldid.voidsetMetadataFields(List<String> metadataFields) voidsetMetadataToAdd(String metadataToAdd) voidSetter for the fieldowner.voidsetQuestionType(QuestionType questionType) Setter for the fieldquestionType.voidsetTargetFrequency(int targetFrequency) Setter for the fieldtargetFrequency.voidsetTargetSelector(TargetSelector targetSelector) Setter for the fieldtargetSelector.
-
Constructor Details
-
Question
public Question()Empty constructor. -
Question
constructor setting the owning campaign- Parameters:
owner- aCampaignobject.
-
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- aQuestionTypeobject.targetSelector- aTargetSelectorobject.targetFrequency- a int.owner- aCampaignobject.
-
Question
- Parameters:
orig-
-
Question
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
getAvailableQuestionTypes.
- Returns:
- available values of the QuestionType enum
-
getAvailableTargetSelectors
getAvailableTargetSelectors.
- Returns:
- available values of the TargetSelector enum
-
getId
Getter for the field
id.- Returns:
- the id
-
setId
Setter for the field
id.- Parameters:
id- the id to set
-
getOwner
Getter for the field
owner.- Returns:
- the owner
-
setOwner
Setter for the field
owner.- Parameters:
owner- the owner to set
-
getText
- Returns:
- the tempTranslations
-
getQuestionType
Getter for the field
questionType.- Returns:
- the questionType
-
setQuestionType
Setter for the field
questionType.- Parameters:
questionType- the questionType to set
-
getTargetSelector
Getter for the field
targetSelector.- Returns:
- the targetSelector
-
setTargetSelector
Setter for the field
targetSelector.- Parameters:
targetSelector- the targetSelector to set
-
getTargetFrequency
public int getTargetFrequency()Getter for the field
targetFrequency.- Returns:
- the targetFrequency
-
getMetadataFields
- Returns:
- the metadataFields
-
setMetadataFields
- Parameters:
metadataFields- the metadataFields to set
-
addMetadataField
-
removeMetadataField
-
setMetadataToAdd
- Parameters:
metadataToAdd- the metadataToAdd to set
-
getMetadataToAdd
- Returns:
- the metadataToAdd
-
getAvailableMetadataFields
- Returns:
- a list of all "MD_" fields from solr
- Throws:
IOExceptionorg.apache.solr.client.solrj.SolrServerExceptionIndexUnreachableException
-
setTargetFrequency
public void setTargetFrequency(int targetFrequency) Setter for the field
targetFrequency.- Parameters:
targetFrequency- the targetFrequency to set
-
getQuestionId
get theidof a question from an URI identifier -
getCampaignId
get theCampaign.idof the owning campaign from an URI identifier of a question -
getIdAsURI
getIdAsURI.
- Returns:
- The URI identifier for this question from the question and campaign id
-
getAuthorityData
Currently only returns GND authority data.- Returns:
- Normdata authority data if the question type is NORMDATA, otherwise null
-
getMetadataFieldSelection
- Returns:
- the metadataFieldSelection
- Throws:
IOExceptionorg.apache.solr.client.solrj.SolrServerException
-
getSelectedMetadataFields
-