// we'll only accept queries for ProductId=some_id
String kwdQuery = query.getKwdQueryString();
String[] kwdQueryToks = kwdQuery.split("=");
if (kwdQueryToks == null
|| (kwdQueryToks != null && kwdQueryToks.length != 2)) {
throw new ProductException(
"Malformed query: CASProductHandler only accepts queries of the "
+ "form " + PRODUCT_ID
+ " = <some product id>: your query was: "
+ kwdQuery);
}
String prodId = kwdQueryToks[1];
Product product = null;
try {
product = this.fm.getProductById(prodId);
product.setProductReferences(this.fm.getProductReferences(product));
} catch (CatalogException e) {
throw new ProductException(
"Exception querying file manager for product: [" + prodId
+ "]: Message: " + e.getMessage());
}
try {
addResultsFromProductId(query, product);
} catch (URISyntaxException e) {
throw new ProductException(
"URI Syntax Exception deciphering product: ["
+ product.getProductName() + "]: Message: "
+ e.getMessage());
}
return query;