Search in sources :

Example 1 with ExternalizedProperty

use of org.granite.messaging.amf.io.util.externalizer.annotation.ExternalizedProperty in project collect by openforis.

the class SamplingDesignSummariesProxy method getInfoAttributes.

@ExternalizedProperty
public List<String> getInfoAttributes() {
    ReferenceDataSchema referenceDataSchema = survey.getReferenceDataSchema();
    SamplingPointDefinition samplingPoint = referenceDataSchema == null ? null : referenceDataSchema.getSamplingPointDefinition();
    if (samplingPoint == null) {
        return Collections.emptyList();
    } else {
        List<String> result = new ArrayList<String>();
        List<ReferenceDataDefinition.Attribute> infoAttributes = samplingPoint.getAttributes(false);
        for (ReferenceDataDefinition.Attribute attribute : infoAttributes) {
            result.add(attribute.getName());
        }
        return result;
    }
}
Also used : ReferenceDataSchema(org.openforis.idm.metamodel.ReferenceDataSchema) SamplingPointDefinition(org.openforis.idm.metamodel.ReferenceDataSchema.SamplingPointDefinition) ArrayList(java.util.ArrayList) ReferenceDataDefinition(org.openforis.idm.metamodel.ReferenceDataSchema.ReferenceDataDefinition) ExternalizedProperty(org.granite.messaging.amf.io.util.externalizer.annotation.ExternalizedProperty)

Example 2 with ExternalizedProperty

use of org.granite.messaging.amf.io.util.externalizer.annotation.ExternalizedProperty in project collect by openforis.

the class DataImportSummaryItemProxy method getWarnings.

@ExternalizedProperty
public List<NodeUnmarshallingErrorProxy> getWarnings() {
    List<NodeUnmarshallingError> result = new ArrayList<NodeUnmarshallingError>();
    Map<Step, List<NodeUnmarshallingError>> warnings = item.getWarnings();
    if (warnings != null) {
        Set<Step> steps = warnings.keySet();
        for (Step step : steps) {
            List<NodeUnmarshallingError> warningsPerStep = warnings.get(step);
            result.addAll(warningsPerStep);
        }
    }
    List<NodeUnmarshallingErrorProxy> proxies = NodeUnmarshallingErrorProxy.fromList(result);
    return proxies;
}
Also used : NodeUnmarshallingError(org.openforis.collect.persistence.xml.NodeUnmarshallingError) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) Step(org.openforis.collect.model.CollectRecord.Step) ExternalizedProperty(org.granite.messaging.amf.io.util.externalizer.annotation.ExternalizedProperty)

Example 3 with ExternalizedProperty

use of org.granite.messaging.amf.io.util.externalizer.annotation.ExternalizedProperty in project collect by openforis.

the class SurveyBackupJobProxy method getOutputFileName.

@ExternalizedProperty
public String getOutputFileName() {
    SurveyBackupJob job = (SurveyBackupJob) this.getJob();
    File outputFile = job.getOutputFile();
    return outputFile == null ? null : outputFile.getAbsolutePath();
}
Also used : SurveyBackupJob(org.openforis.collect.io.SurveyBackupJob) File(java.io.File) ExternalizedProperty(org.granite.messaging.amf.io.util.externalizer.annotation.ExternalizedProperty)

Example 4 with ExternalizedProperty

use of org.granite.messaging.amf.io.util.externalizer.annotation.ExternalizedProperty in project collect by openforis.

the class EntityDefinitionProxy method getDirection.

@ExternalizedProperty
public Direction getDirection() {
    CollectSurvey survey = (CollectSurvey) entityDefinition.getSurvey();
    UIOptions uiOpts = survey.getUIOptions();
    Direction result = uiOpts.getDirection(entityDefinition);
    return result;
}
Also used : UIOptions(org.openforis.collect.metamodel.ui.UIOptions) CollectSurvey(org.openforis.collect.model.CollectSurvey) Direction(org.openforis.collect.metamodel.ui.UIOptions.Direction) ExternalizedProperty(org.granite.messaging.amf.io.util.externalizer.annotation.ExternalizedProperty)

Example 5 with ExternalizedProperty

use of org.granite.messaging.amf.io.util.externalizer.annotation.ExternalizedProperty in project collect by openforis.

the class EntityDefinitionProxy method getLayout.

@ExternalizedProperty
public String getLayout() {
    CollectSurvey survey = (CollectSurvey) entityDefinition.getSurvey();
    UIOptions uiOpts = survey.getUIOptions();
    Layout layout = uiOpts.getLayout(entityDefinition);
    return layout.name().toLowerCase(Locale.ENGLISH);
}
Also used : Layout(org.openforis.collect.metamodel.ui.UIOptions.Layout) UIOptions(org.openforis.collect.metamodel.ui.UIOptions) CollectSurvey(org.openforis.collect.model.CollectSurvey) ExternalizedProperty(org.granite.messaging.amf.io.util.externalizer.annotation.ExternalizedProperty)

Aggregations

ExternalizedProperty (org.granite.messaging.amf.io.util.externalizer.annotation.ExternalizedProperty)15 ArrayList (java.util.ArrayList)10 NodeDefinition (org.openforis.idm.metamodel.NodeDefinition)6 UIOptions (org.openforis.collect.metamodel.ui.UIOptions)4 List (java.util.List)3 CollectSurvey (org.openforis.collect.model.CollectSurvey)3 HashMap (java.util.HashMap)2 ValidationResultFlag (org.openforis.idm.metamodel.validation.ValidationResultFlag)2 File (java.io.File)1 SurveyBackupJob (org.openforis.collect.io.SurveyBackupJob)1 CodeListItemProxy (org.openforis.collect.metamodel.proxy.CodeListItemProxy)1 Direction (org.openforis.collect.metamodel.ui.UIOptions.Direction)1 Layout (org.openforis.collect.metamodel.ui.UIOptions.Layout)1 Step (org.openforis.collect.model.CollectRecord.Step)1 NodeUnmarshallingError (org.openforis.collect.persistence.xml.NodeUnmarshallingError)1 AttributeDefinition (org.openforis.idm.metamodel.AttributeDefinition)1 CodeListItem (org.openforis.idm.metamodel.CodeListItem)1 CodeListService (org.openforis.idm.metamodel.CodeListService)1 EntityDefinition (org.openforis.idm.metamodel.EntityDefinition)1 ReferenceDataSchema (org.openforis.idm.metamodel.ReferenceDataSchema)1