use of org.openforis.idm.metamodel.ModelVersion in project collect by openforis.
the class SurveyBaseVM method getVersionLabel.
public String getVersionLabel(int id) {
if (id > 0) {
CollectSurvey survey = getSurvey();
ModelVersion version = survey.getVersionById(id);
String result = null;
if (version != null) {
result = version.getLabel(currentLanguageCode);
if (result == null) {
result = version.getName();
}
}
return result;
} else {
return Labels.getLabel(EMPTY_OPTION);
}
}
use of org.openforis.idm.metamodel.ModelVersion in project collect by openforis.
the class SurveyBaseVM method getFormVersionIdsWithEmptyOption.
public List<Integer> getFormVersionIdsWithEmptyOption() {
List<ModelVersion> versions = getSurveyFormVersions();
List<Integer> result = new ArrayList<Integer>();
result.add(0, -1);
for (ModelVersion modelVersion : versions) {
result.add(modelVersion.getId());
}
return new BindingListModelList<Integer>(result, false);
}
use of org.openforis.idm.metamodel.ModelVersion in project collect by openforis.
the class EditableListOfNodesVM method getChildDefinitionsInTab.
public List<NodeDefinition> getChildDefinitionsInTab(EntityDefinition entityDefn) {
UIOptions uiOpts = getUIOptions();
List<NodeDefinition> childDefinitions = entityDefn.getChildDefinitions();
List<NodeDefinition> result = new ArrayList<NodeDefinition>();
ModelVersion formVersion = getLayoutFormVersion();
for (NodeDefinition nodeDefn : childDefinitions) {
if (formVersion == null || formVersion.isApplicable(nodeDefn)) {
UITab nodeTab = uiOpts.getAssignedTab(nodeDefn);
if (nodeTab == tab) {
result.add(nodeDefn);
}
}
}
return result;
}
use of org.openforis.idm.metamodel.ModelVersion in project collect by openforis.
the class EditableListOfNodesVM method getChildDefinitions.
public List<NodeDefinition> getChildDefinitions(EntityDefinition entityDefn) {
List<NodeDefinition> result = new ArrayList<NodeDefinition>();
List<NodeDefinition> childDefinitions = entityDefn.getChildDefinitions();
ModelVersion formVersion = getLayoutFormVersion();
for (NodeDefinition nodeDefn : childDefinitions) {
if (formVersion == null || formVersion.isApplicable(nodeDefn)) {
result.add(nodeDefn);
}
}
return childDefinitions;
}
use of org.openforis.idm.metamodel.ModelVersion in project collect by openforis.
the class TabsGroupPanelVM method getNodesPerTab.
public List<NodeDefinition> getNodesPerTab() {
UIOptions uiOpts = getUIOptions();
List<NodeDefinition> result = new ArrayList<NodeDefinition>();
List<NodeDefinition> nodesPerTab = uiOpts.getNodesPerTab(tab, false);
ModelVersion version = getFormVersion();
for (NodeDefinition nodeDefn : nodesPerTab) {
if (version == null || version.isApplicable(nodeDefn)) {
result.add(nodeDefn);
}
}
return result;
}
Aggregations