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
ConstructorDescriptionQuestion()
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 TypeMethodDescriptionvoid
addMetadataField
(String field) Currently only returns GND authority data.getAvailableQuestionTypes.getAvailableTargetSelectors.static Long
getCampaignId
(URI idAsURI) get theCampaign.id
of the owning campaign from an URI identifier of a questiongetId()
Getter for the fieldid
.getIdAsURI.getOwner()
Getter for the fieldowner
.static Long
getQuestionId
(URI idAsURI) get theid
of a question from an URI identifierGetter for the fieldquestionType
.int
Getter for the fieldtargetFrequency
.Getter for the fieldtargetSelector
.getText()
void
removeMetadataField
(String field) void
Call when metadata list changesvoid
Setter for the fieldid
.void
setMetadataFields
(List<String> metadataFields) void
setMetadataToAdd
(String metadataToAdd) void
Setter for the fieldowner
.void
setQuestionType
(QuestionType questionType) Setter for the fieldquestionType
.void
setTargetFrequency
(int targetFrequency) Setter for the fieldtargetFrequency
.void
setTargetSelector
(TargetSelector targetSelector) Setter for the fieldtargetSelector
.
-
Constructor Details
-
Question
public Question()Empty constructor. -
Question
constructor setting the owning campaign- Parameters:
owner
- aCampaign
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
- aQuestionType
object.targetSelector
- aTargetSelector
object.targetFrequency
- a int.owner
- aCampaign
object.
-
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:
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
get theid
of a question from an URI identifier -
getCampaignId
get theCampaign.id
of 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:
IOException
org.apache.solr.client.solrj.SolrServerException
-
getSelectedMetadataFields
-