}
public boolean execute() {
// get the xml parser
QueryXmlHelper helper = null;
try {
helper = createQueryXmlHelper();
} catch ( Exception e ) {
logger.error( "error", e ); //$NON-NLS-1$
return false;
}
// parse the metadata query
IMetadataDomainRepository repo = PentahoSystem.get( IMetadataDomainRepository.class, null );
if ( queryObject == null ) {
// there is no query model, so create one from the query string
// apply templates to the query
String templatedQuery = null;
if ( inputs != null ) {
Properties properties = new Properties();
for ( String name : inputs.keySet() ) {
if ( !( inputs.get( name ) == null ) ) {
properties.put( name, inputs.get( name ).toString() );
}
}
templatedQuery = TemplateUtil.applyTemplate( query, properties, null );
} else {
templatedQuery = query;
}
try {
queryObject = helper.fromXML( repo, templatedQuery );
} catch ( Exception e ) {
logger.error( "error", e ); //$NON-NLS-1$
return false;
}
}