Search in sources :

Example 11 with ExternalizedProperty

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

the class EntityProxy method getChildrenMaxCount.

@ExternalizedProperty
public List<Integer> getChildrenMaxCount() {
    List<Integer> result = new ArrayList<Integer>(availableChildDefinitions.size());
    for (NodeDefinition childDefinition : availableChildDefinitions) {
        Integer count = entity.getMaxCount(childDefinition);
        result.add(count);
    }
    return result;
}
Also used : ArrayList(java.util.ArrayList) NodeDefinition(org.openforis.idm.metamodel.NodeDefinition) ExternalizedProperty(org.granite.messaging.amf.io.util.externalizer.annotation.ExternalizedProperty)

Example 12 with ExternalizedProperty

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

the class EntityProxy method getChildrenMinCount.

@ExternalizedProperty
public List<Integer> getChildrenMinCount() {
    List<Integer> result = new ArrayList<Integer>(availableChildDefinitions.size());
    for (NodeDefinition childDefinition : availableChildDefinitions) {
        int count = entity.getMinCount(childDefinition);
        result.add(count);
    }
    return result;
}
Also used : ArrayList(java.util.ArrayList) NodeDefinition(org.openforis.idm.metamodel.NodeDefinition) ExternalizedProperty(org.granite.messaging.amf.io.util.externalizer.annotation.ExternalizedProperty)

Example 13 with ExternalizedProperty

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

the class EntityProxy method getChildrenMinCountValidation.

@ExternalizedProperty
public List<ValidationResultFlag> getChildrenMinCountValidation() {
    List<ValidationResultFlag> result = new ArrayList<ValidationResultFlag>(availableChildDefinitions.size());
    for (NodeDefinition childDefinition : availableChildDefinitions) {
        ValidationResultFlag valid = entity.getMinCountValidationResult(childDefinition);
        result.add(valid);
    }
    return result;
}
Also used : ValidationResultFlag(org.openforis.idm.metamodel.validation.ValidationResultFlag) ArrayList(java.util.ArrayList) NodeDefinition(org.openforis.idm.metamodel.NodeDefinition) ExternalizedProperty(org.granite.messaging.amf.io.util.externalizer.annotation.ExternalizedProperty)

Example 14 with ExternalizedProperty

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

the class CoordinateAttributeDefinitionProxy method getFieldsOrder.

@ExternalizedProperty
public CoordinateAttributeFieldsOrder getFieldsOrder() {
    CollectSurvey survey = (CollectSurvey) nodeDefinition.getSurvey();
    UIOptions uiOptions = survey.getUIOptions();
    return uiOptions.getFieldsOrder((CoordinateAttributeDefinition) nodeDefinition);
}
Also used : UIOptions(org.openforis.collect.metamodel.ui.UIOptions) CollectSurvey(org.openforis.collect.model.CollectSurvey) ExternalizedProperty(org.granite.messaging.amf.io.util.externalizer.annotation.ExternalizedProperty)

Example 15 with ExternalizedProperty

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

the class AttributeDefinitionProxy method getVisibleFieldIndexes.

@ExternalizedProperty
public List<Integer> getVisibleFieldIndexes() {
    List<Integer> result = new ArrayList<Integer>();
    UIOptions uiOptions = getUIOptions();
    String[] fieldNames = uiOptions.getVisibleFields(attributeDefinition);
    for (String fieldName : fieldNames) {
        int fieldIdx = attributeDefinition.getFieldNames().indexOf(fieldName);
        if (fieldIdx < 0) {
            throw new IllegalStateException(String.format("Field %s not found in attribute definition %s", fieldName, attributeDefinition.getName()));
        }
        result.add(fieldIdx);
    }
    return result;
}
Also used : UIOptions(org.openforis.collect.metamodel.ui.UIOptions) ArrayList(java.util.ArrayList) 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