Search in sources :

Example 21 with CollectAnnotations

use of org.openforis.collect.metamodel.CollectAnnotations in project collect by openforis.

the class FileAttributeDefinitionFormObject method loadFrom.

@Override
public void loadFrom(T source, String languageCode) {
    super.loadFrom(source, languageCode);
    maxSize = convertToMB(source.getMaxSize());
    CollectAnnotations annotations = ((CollectSurvey) source.getSurvey()).getAnnotations();
    fileType = annotations.getFileType(source).name();
}
Also used : CollectAnnotations(org.openforis.collect.metamodel.CollectAnnotations) CollectSurvey(org.openforis.collect.model.CollectSurvey)

Example 22 with CollectAnnotations

use of org.openforis.collect.metamodel.CollectAnnotations in project collect by openforis.

the class EntityDefinition method setEnumerate.

public void setEnumerate(boolean enumerate) {
    CollectSurvey survey = getSurvey();
    CollectAnnotations annotations = survey.getAnnotations();
    annotations.setEnumerate(this, enumerate);
}
Also used : CollectAnnotations(org.openforis.collect.metamodel.CollectAnnotations) CollectSurvey(org.openforis.collect.model.CollectSurvey)

Example 23 with CollectAnnotations

use of org.openforis.collect.metamodel.CollectAnnotations in project collect by openforis.

the class EntityDefinition method isEnumerate.

public boolean isEnumerate() {
    // TODO don't use annotations
    CollectSurvey survey = getSurvey();
    CollectAnnotations annotations = survey.getAnnotations();
    return annotations.isEnumerate(this);
}
Also used : CollectAnnotations(org.openforis.collect.metamodel.CollectAnnotations) CollectSurvey(org.openforis.collect.model.CollectSurvey)

Example 24 with CollectAnnotations

use of org.openforis.collect.metamodel.CollectAnnotations in project collect by openforis.

the class TextAttributeDefinitionFormObject method loadFrom.

@Override
public void loadFrom(T source, String languageCode) {
    super.loadFrom(source, languageCode);
    Type typeEnum = source.getType();
    if (typeEnum == null) {
        typeEnum = Type.SHORT;
    }
    type = typeEnum.name();
    autocompleteGroup = source.getAnnotation(Annotation.AUTOCOMPLETE.getQName());
    UIOptions uiOptions = getUIOptions(source);
    autoUppercase = uiOptions.isAutoUppercase(source);
    CollectAnnotations annotations = ((CollectSurvey) source.getSurvey()).getAnnotations();
    TextInput textInput = annotations.getTextInput(source);
    input = textInput.name();
    geometry = annotations.isGeometry(source);
}
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)

Example 25 with CollectAnnotations

use of org.openforis.collect.metamodel.CollectAnnotations in project collect by openforis.

the class CalculatedAttributeDefinitionFormObject method saveTo.

@Override
public void saveTo(T dest, String languageCode) {
    super.saveTo(dest, languageCode);
    dest.setType(Type.valueOf(type));
    dest.setFormulas(formulas);
    CollectSurvey survey = (CollectSurvey) dest.getSurvey();
    // include in data export
    CollectAnnotations annotations = survey.getAnnotations();
    annotations.setIncludeInDataExport(dest, includeInDataExport);
    // show in ui
    UIOptions uiOptions = survey.getUIOptions();
    uiOptions.setShowInUI(dest, showInUI);
}
Also used : UIOptions(org.openforis.collect.metamodel.ui.UIOptions) CollectAnnotations(org.openforis.collect.metamodel.CollectAnnotations) CollectSurvey(org.openforis.collect.model.CollectSurvey)

Aggregations

CollectAnnotations (org.openforis.collect.metamodel.CollectAnnotations)32 CollectSurvey (org.openforis.collect.model.CollectSurvey)21 AttributeDefinition (org.openforis.idm.metamodel.AttributeDefinition)11 UIOptions (org.openforis.collect.metamodel.ui.UIOptions)9 CodeAttributeDefinition (org.openforis.idm.metamodel.CodeAttributeDefinition)7 NodeDefinition (org.openforis.idm.metamodel.NodeDefinition)7 BooleanAttributeDefinition (org.openforis.idm.metamodel.BooleanAttributeDefinition)6 EntityDefinition (org.openforis.idm.metamodel.EntityDefinition)6 CoordinateAttributeDefinition (org.openforis.idm.metamodel.CoordinateAttributeDefinition)5 TextAttributeDefinition (org.openforis.idm.metamodel.TextAttributeDefinition)5 ArrayList (java.util.ArrayList)4 DateAttributeDefinition (org.openforis.idm.metamodel.DateAttributeDefinition)4 NumberAttributeDefinition (org.openforis.idm.metamodel.NumberAttributeDefinition)4 NumericAttributeDefinition (org.openforis.idm.metamodel.NumericAttributeDefinition)4 TimeAttributeDefinition (org.openforis.idm.metamodel.TimeAttributeDefinition)4 KeyAttributeDefinition (org.openforis.idm.metamodel.KeyAttributeDefinition)3 NodeDefinitionVisitor (org.openforis.idm.metamodel.NodeDefinitionVisitor)3 RangeAttributeDefinition (org.openforis.idm.metamodel.RangeAttributeDefinition)3 TextInput (org.openforis.collect.metamodel.CollectAnnotations.TextInput)2 UIConfiguration (org.openforis.collect.metamodel.ui.UIConfiguration)2