use of org.openforis.idm.metamodel.validation.LookupProvider in project collect by openforis.
the class IDMFunctions method samplingPointDataLookup.
private static Object samplingPointDataLookup(ExpressionContext context, String attribute, String... keys) {
if (validateSamplingPointKeys(keys)) {
LookupProvider lookupProvider = getLookupProvider(context);
Survey survey = getSurvey(context);
Object data = lookupProvider.lookupSamplingPointData(survey, attribute, keys);
return data;
} else {
return null;
}
}
use of org.openforis.idm.metamodel.validation.LookupProvider in project collect by openforis.
the class CustomFunctions method getLookupProvider.
protected static LookupProvider getLookupProvider(ExpressionContext context) {
ModelJXPathContext jxPathContext = (ModelJXPathContext) context.getJXPathContext();
LookupProvider lookupProvider = jxPathContext.getLookupProvider();
return lookupProvider;
}
use of org.openforis.idm.metamodel.validation.LookupProvider in project collect by openforis.
the class IDMFunctions method samplingPointCoordinateLookup.
private static Coordinate samplingPointCoordinateLookup(ExpressionContext context, String... keys) {
if (validateSamplingPointKeys(keys)) {
LookupProvider lookupProvider = getLookupProvider(context);
Survey survey = getSurvey(context);
Coordinate coordinate = lookupProvider.lookupSamplingPointCoordinate(survey, keys);
return coordinate;
} else {
return null;
}
}
use of org.openforis.idm.metamodel.validation.LookupProvider in project collect by openforis.
the class IDMFunctions method lookup.
private static Object lookup(ExpressionContext context, String name, String attribute, String... keys) {
LookupProvider lookupProvider = getLookupProvider(context);
Survey survey = getSurvey(context);
Object result = lookupProvider.lookup(survey, name, attribute, (Object[]) keys);
if (result == null) {
return null;
} else if (LOCATION_ATTRIBUTE.equalsIgnoreCase(attribute)) {
// convert to Coordinate
Coordinate coordinate = Coordinate.parseCoordinate(result.toString());
return coordinate;
} else {
return result;
}
}
Aggregations