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();
}
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);
}
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);
}
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);
}
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);
}
Aggregations