use of org.openforis.idm.metamodel.NodeDefinition in project collect by openforis.
the class EntityChangeProxy method convertToChildDefinitionIdMap.
private <V extends Object> Map<Integer, V> convertToChildDefinitionIdMap(Map<String, V> from) {
EntityDefinition entityDef = change.getNode().getDefinition();
Map<Integer, V> map = new HashMap<Integer, V>();
Set<Entry<String, V>> entries = from.entrySet();
for (Entry<String, V> entry : entries) {
String childName = entry.getKey();
NodeDefinition childDef = entityDef.getChildDefinition(childName);
Integer childDefId = childDef.getId();
map.put(childDefId, entry.getValue());
}
return map;
}
use of org.openforis.idm.metamodel.NodeDefinition in project collect by openforis.
the class EntityProxy method getChildrenByDefinitionId.
@ExternalizedProperty
public Map<Integer, List<NodeProxy>> getChildrenByDefinitionId() {
Map<Integer, List<NodeProxy>> result = new HashMap<Integer, List<NodeProxy>>();
for (NodeDefinition childDefinition : availableChildDefinitions) {
List<Node<?>> nodes = this.entity.getChildren(childDefinition);
List<NodeProxy> proxies = NodeProxy.fromList(this, nodes, context);
result.put(childDefinition.getId(), proxies);
}
return result;
}
use of org.openforis.idm.metamodel.NodeDefinition in project collect by openforis.
the class EntityProxy method getChildrenMaxCountValidation.
@ExternalizedProperty
public List<ValidationResultFlag> getChildrenMaxCountValidation() {
List<ValidationResultFlag> result = new ArrayList<ValidationResultFlag>(availableChildDefinitions.size());
for (NodeDefinition childDefinition : availableChildDefinitions) {
ValidationResultFlag valid = entity.getMaxCountValidationResult(childDefinition);
result.add(valid);
}
return result;
}
use of org.openforis.idm.metamodel.NodeDefinition in project collect by openforis.
the class EntityProxy method getAvailableChildDefinitions.
private List<NodeDefinition> getAvailableChildDefinitions() {
List<NodeDefinition> result = new ArrayList<NodeDefinition>();
UIOptions uiOptions = ((CollectSurvey) entity.getSurvey()).getUIOptions();
for (NodeDefinition childDefinition : getChildDefinitions()) {
if (isApplicable(childDefinition) && !uiOptions.isHidden(childDefinition)) {
result.add(childDefinition);
}
}
return result;
}
use of org.openforis.idm.metamodel.NodeDefinition in project collect by openforis.
the class UIModelObjectView method getNodeDefinition.
protected NodeDefinition getNodeDefinition(int defId) {
CollectSurvey survey = getSurvey();
NodeDefinition def = survey.getSchema().getDefinitionById(defId);
return def;
}
Aggregations