Search in sources :

Example 41 with CollectSurvey

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;
}
Also used : Record(org.jooq.Record) CollectSurvey(org.openforis.collect.model.CollectSurvey)

Example 42 with CollectSurvey

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;
}
Also used : Record(org.jooq.Record) CollectSurvey(org.openforis.collect.model.CollectSurvey)

Example 43 with CollectSurvey

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);
}
Also used : CollectAnnotations(org.openforis.collect.metamodel.CollectAnnotations) CollectSurvey(org.openforis.collect.model.CollectSurvey)

Example 44 with CollectSurvey

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);
}
Also used : CollectAnnotations(org.openforis.collect.metamodel.CollectAnnotations) CollectSurvey(org.openforis.collect.model.CollectSurvey)

Example 45 with CollectSurvey

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);
}
Also used : Type(org.openforis.idm.metamodel.TextAttributeDefinition.Type) UIOptions(org.openforis.collect.metamodel.ui.UIOptions) CollectAnnotations(org.openforis.collect.metamodel.CollectAnnotations) CollectSurvey(org.openforis.collect.model.CollectSurvey) TextInput(org.openforis.collect.metamodel.CollectAnnotations.TextInput)

Aggregations

CollectSurvey (org.openforis.collect.model.CollectSurvey)329 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)53 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)40 UIOptions (org.openforis.collect.metamodel.ui.UIOptions)38 CollectRecord (org.openforis.collect.model.CollectRecord)30 RecordFilter (org.openforis.collect.model.RecordFilter)27 Transactional (org.springframework.transaction.annotation.Transactional)26 EntityDefinition (org.openforis.idm.metamodel.EntityDefinition)25 ArrayList (java.util.ArrayList)23 File (java.io.File)21 CollectAnnotations (org.openforis.collect.metamodel.CollectAnnotations)21 Secured (org.springframework.security.access.annotation.Secured)20 User (org.openforis.collect.model.User)19 NodeDefinition (org.openforis.idm.metamodel.NodeDefinition)19 SessionState (org.openforis.collect.web.session.SessionState)18 AttributeDefinition (org.openforis.idm.metamodel.AttributeDefinition)17 Test (org.junit.Test)16 CollectRecordSummary (org.openforis.collect.model.CollectRecordSummary)15 CodeList (org.openforis.idm.metamodel.CodeList)15 Schema (org.openforis.idm.metamodel.Schema)15