Node ndPropName = (Node)xpath.evaluate("ogc:PropertyName",parent,XPathConstants.NODE);
if (ndPropName != null) {
sPropName = Val.chkStr(ndPropName.getTextContent());
}
String msg = sErr+" - PropertyIsLike is the only supported operand for PropertyName: "+sPropName;
throw new OwsException(OwsException.OWSCODE_InvalidParameterValue,"PropertyName",msg);
}
}
// between comparison - set lower and upper boundaries
if (propertyClause instanceof PropertyClause.PropertyIsBetween) {
PropertyClause.PropertyIsBetween between;
between = (PropertyClause.PropertyIsBetween)propertyClause;
Node ndLower = (Node)xpath.evaluate("ogc:LowerBoundary",parent,XPathConstants.NODE);
Node ndUpper = (Node)xpath.evaluate("ogc:UpperBoundary",parent,XPathConstants.NODE);
String sLower = "";
String sUpper = "";
if ((ndLower == null) && (ndUpper == null)) {
String msg = sErr+" - a LowerBoundary or UpperBoundary was not found.";
throw new OwsException(OwsException.OWSCODE_MissingParameterValue,"PropertyIsBetween",msg);
}
if (ndLower != null) {
sLower = ndLower.getTextContent();
between.setLowerBoundary(sLower);
// TODO validate content
}
if (ndUpper != null) {
sUpper = ndUpper.getTextContent();
between.setUpperBoundary(sUpper);
// TODO validate content
}
if ((sLower == null) || (sLower.length() == 0)) {
if ((sUpper == null) || (sUpper.length() == 0)) {
String msg = sErr+" - the LowerBoundary and UpperBoundary are empty.";
throw new OwsException(OwsException.OWSCODE_InvalidParameterValue,"PropertyIsBetween",msg);
}
}
// null check - no literal required
} else if (propertyClause instanceof PropertyClause.PropertyIsNull) {
// non-range clauses
} else {
Node ndLiteral = (Node)xpath.evaluate("ogc:Literal", parent,XPathConstants.NODE);
if (ndLiteral == null) {
String msg = sErr+" - an ogc:Literal was not found.";
throw new OwsException(OwsException.OWSCODE_MissingParameterValue,"Literal",msg);
}
String sLiteral = ndLiteral.getTextContent();
propertyClause.setLiteral(sLiteral);
// TODO validate content
if ((sLiteral == null) || (sLiteral.length() == 0)) {
String msg = sErr+".ogc:Literal - the supplied literal was empty.";
throw new OwsException(OwsException.OWSCODE_InvalidParameterValue,"Literal",msg);
}
// set like comparison attributes
if (propertyClause instanceof PropertyClause.PropertyIsLike) {
PropertyClause.PropertyIsLike like;