+ "<constraints>"
+ "<constraint><operator>AND</operator><condition>EQUALS([CATEGORY.LC_CUSTOMERNAME];"
+ "[param:param1])</condition></constraint>"
+ "</constraints>" + "</mql>";
MetadataQueryComponent component = new MetadataQueryComponent();
component.setQuery( mql );
component.execute();
IPentahoResultSet rs = component.getResultSet();
try {
Assert.assertNotNull( rs );
Assert.assertEquals( 2, rs.getRowCount() );
Object[] obj;
while ( ( obj = rs.next() ) != null ) {
System.out.println( obj[0] );
}
} finally {
rs.close();
rs.closeConnection();
}
component = new MetadataQueryComponent();
Map<String, Object> inputs = new HashMap<String, Object>();
inputs.put( "param1", new String[] { "BG&E Collectables", "Baane Mini Imports",
"Bavarian Collectables Imports, Co.", "Boards & Toys Co." } );
component.setInputs( inputs );
component.setQuery( mql );
component.execute();
rs = component.getResultSet();
try {
Assert.assertNotNull( rs );
Assert.assertEquals( 4, rs.getRowCount() );
Object[] obj;
while ( ( obj = rs.next() ) != null ) {
System.out.println( obj[0] );
}
} finally {
rs.close();
rs.closeConnection();
}
mql =
"<mql><domain_id>DOMAIN</domain_id><model_id>MODEL</model_id>"
+ "<parameters><parameter name=\"param1\" type=\"NUMERIC\" defaultValue=\"1504|1337\"/></parameters>"
+ "<selections><selection>"
+ "<view>CATEGORY</view>"
+ "<column>LC_CUSTOMERNAME</column>"
+ "</selection><selection>"
+ "<view>CATEGORY</view>"
+ "<column>LC_SALESREP</column>"
+ "</selection>"
+ "</selections>"
+ "<constraints>"
+ "<constraint><operator>AND</operator><condition>EQUALS([CATEGORY.LC_SALESREP];"
+ "[param:param1])</condition></constraint>"
+ "</constraints>" + "</mql>";
component = new MetadataQueryComponent();
component.setQuery( mql );
component.execute();
rs = component.getResultSet();
try {
Assert.assertNotNull( rs );
Assert.assertEquals( 15, rs.getRowCount() );
Object[] obj;
while ( ( obj = rs.next() ) != null ) {