use of org.openforis.collect.model.CollectSurvey in project collect by openforis.
the class SurveyWorkDao method loadByUri.
public CollectSurvey loadByUri(String uri) {
Record record = dsl().select().from(OFC_SURVEY_WORK).where(OFC_SURVEY_WORK.URI.equal(uri)).fetchOne();
CollectSurvey survey = processSurveyRow(record);
return survey;
}
use of org.openforis.collect.model.CollectSurvey in project collect by openforis.
the class SurveyWorkDao method loadByName.
public CollectSurvey loadByName(String name) {
Record record = dsl().select().from(OFC_SURVEY_WORK).where(OFC_SURVEY_WORK.NAME.equal(name)).fetchOne();
CollectSurvey survey = processSurveyRow(record);
return survey;
}
use of org.openforis.collect.model.CollectSurvey in project collect by openforis.
the class TaxonAttributeDefinitionFormObject method saveTo.
@Override
public void saveTo(TaxonAttributeDefinition dest, String languageCode) {
super.saveTo(dest, languageCode);
dest.setTaxonomy(taxonomy);
dest.setHighestTaxonRank(TaxonRank.fromName(highestRank));
dest.setQualifiers(qualifiers);
dest.setFieldLabel(CODE_FIELD_NAME, languageCode, codeFieldLabel);
dest.setFieldLabel(SCIENTIFIC_NAME_FIELD_NAME, languageCode, scientificNameFieldLabel);
dest.setFieldLabel(VERNACULAR_NAME_FIELD_NAME, languageCode, vernacularNameFieldLabel);
dest.setFieldLabel(LANGUAGE_CODE_FIELD_NAME, languageCode, languageCodeFieldLabel);
dest.setFieldLabel(LANGUAGE_VARIETY_FIELD_NAME, languageCode, languageVarietyFieldLabel);
dest.setFieldLabel(FAMILY_CODE_FIELD_NAME, languageCode, familyCodeFieldLabel);
dest.setFieldLabel(FAMILY_SCIENTIFIC_NAME_FIELD_NAME, languageCode, familyNameFieldLabel);
CollectSurvey survey = (CollectSurvey) dest.getSurvey();
CollectAnnotations annotations = survey.getAnnotations();
annotations.setShowFamily(dest, showFamily);
annotations.setIncludeUniqueVernacularName(dest, includeUniqueVernacularName);
annotations.setAllowUnlisted(dest, allowUnlisted);
}
use of org.openforis.collect.model.CollectSurvey in project collect by openforis.
the class TaxonAttributeDefinitionFormObject method loadFrom.
@Override
public void loadFrom(TaxonAttributeDefinition source, String languageCode) {
super.loadFrom(source, languageCode);
taxonomy = source.getTaxonomy();
highestRank = source.getHighestTaxonRank() == null ? null : source.getHighestTaxonRank().getName();
qualifiers = new ArrayList<String>(source.getQualifiers());
CollectSurvey survey = (CollectSurvey) source.getSurvey();
CollectAnnotations annotations = survey.getAnnotations();
showFamily = annotations.isShowFamily(source);
includeUniqueVernacularName = annotations.isIncludeUniqueVernacularName(source);
allowUnlisted = annotations.isAllowUnlisted(source);
codeFieldLabel = source.getFieldLabel(CODE_FIELD_NAME, languageCode);
scientificNameFieldLabel = source.getFieldLabel(SCIENTIFIC_NAME_FIELD_NAME, languageCode);
vernacularNameFieldLabel = source.getFieldLabel(VERNACULAR_NAME_FIELD_NAME, languageCode);
languageCodeFieldLabel = source.getFieldLabel(LANGUAGE_CODE_FIELD_NAME, languageCode);
languageVarietyFieldLabel = source.getFieldLabel(LANGUAGE_VARIETY_FIELD_NAME, languageCode);
familyCodeFieldLabel = source.getFieldLabel(FAMILY_CODE_FIELD_NAME, languageCode);
familyNameFieldLabel = source.getFieldLabel(FAMILY_SCIENTIFIC_NAME_FIELD_NAME, languageCode);
}
use of org.openforis.collect.model.CollectSurvey in project collect by openforis.
the class TextAttributeDefinitionFormObject method saveTo.
@Override
public void saveTo(T dest, String languageCode) {
super.saveTo(dest, languageCode);
Type typeEnum = TextAttributeDefinition.Type.valueOf(type);
dest.setType(typeEnum);
dest.setAnnotation(Annotation.AUTOCOMPLETE.getQName(), autocompleteGroup);
UIOptions uiOptions = getUIOptions(dest);
uiOptions.setAutoUppercase(dest, autoUppercase);
CollectAnnotations annotations = ((CollectSurvey) dest.getSurvey()).getAnnotations();
TextInput textInput = TextInput.valueOf(input);
annotations.setTextInput(dest, textInput);
annotations.setGeometry(dest, geometry);
}
Aggregations