private String getCQLString(IRQuery q) throws InvalidQueryException {
// Here we need to get an instance of CQLQuery.. So if thats not what we have been passed,
// this is the place to create one.
log.fine("Class of IRQuery: "+q.getQueryModel().getClass().getName());
CQLString cql_string = null;
QueryModel qm = q.getQueryModel();
if ( qm instanceof CQLString )
cql_string = (CQLString)qm;
else
cql_string = CQLBuilder.buildFrom(qm, ctx);
String retval = cql_string.toString();
log.fine("cql to use is : "+retval);
// return "dc.title=science";
return retval;
}