*/
public void evaluateIdQuery(OperationContext context, String[] ids)
throws Exception {
// initialize
QueryOptions qOptions = context.getRequestOptions().getQueryOptions();
DiscoveryQuery query = this.getDiscoveryContext().getDiscoveryQuery();
// the outputSchema may have to be used to filter the query
// response generator is
// outputSchema+ElementSetName+ElementSetName@typeNames+Query@typeNames based
/*
String elementSetType = Val.chkStr(qOptions.getElementSetType());
String outputSchema = Val.chkStr(qOptions.getOutputSchema());
StringSet elementSetTypeNames = qOptions.getElementSetTypeNames();
boolean isBrief = elementSetType.equalsIgnoreCase(CswConstants.ElementSetType_Brief);
boolean isSummary = elementSetType.equalsIgnoreCase(CswConstants.ElementSetType_Summary);
boolean isFull = elementSetType.equalsIgnoreCase(CswConstants.ElementSetType_Full);
*/
// ensure that there are IDs to query
String locator = "Id";
if (ids == null) {
String msg = "The Id parameter was missing.";
throw new OwsException(OwsException.OWSCODE_MissingParameterValue,locator,msg);
} else if (ids.length == 0) {
String msg = "No Valid IDs were supplied.";
throw new OwsException(OwsException.OWSCODE_InvalidParameterValue,locator,msg);
}
// determine the queryables
// determine the discoverable
Discoverable discoverable = this.getDiscoveryContext().findDiscoverable("Id");
if (discoverable == null) {
String msg = "The Id queryable is not supported.";
throw new OwsException(OwsException.OWSCODE_InvalidParameterValue,locator,msg);
}
// build the discovery filter
query.getFilter().setRootClause(new LogicalClause.LogicalOr());
for (String id: ids) {
id = Val.chkStr(id);
if (id.length() == 0) {
String msg = "A supplied ID was empty.";
throw new OwsException(OwsException.OWSCODE_InvalidParameterValue,locator,msg);
} else {
PropertyClause propertyClause = new PropertyClause.PropertyIsEqualTo();
propertyClause.setTarget(discoverable);
propertyClause.setLiteral(id);
query.getFilter().getRootClause().getClauses().add(propertyClause);
}
}
int nIds = query.getFilter().getRootClause().getClauses().size();
qOptions.setStartRecord(1);
qOptions.setMaxRecords(nIds);
// sdi.suite SmartEditor
if ((nIds == 1) && !qOptions.isDublinCoreResponse()) {
String schemaName = Val.chkStr(qOptions.getSchemaFilter());
if (schemaName.equalsIgnoreCase("http://www.isotc211.org/2005/gmd")) {
TransactionOptions tOptions = context.getRequestOptions().getTransactionOptions();
if ((tOptions.getPublicationMethod() != null) && (tOptions.getPublicationMethod().length() > 0)) {
if (tOptions.getPublicationMethod().equals("seditor")) {
OriginalXmlProvider oxp = new OriginalXmlProvider();