/**
* todo: fine tune this method:
* @param output
*/
private void createAndAddAdapter(Output output,Map<String,String[]> parameterMap) throws InvalidInputException, ParseException {
CFDynaBeanAdapter adapter = new CFDynaBeanAdapter();
adapter.setDataSource(output.getQuery().getDataSource());
adapter.setUseName(false);
adapter.setDefaultNumberPerPage(output.getOutputElement().getRowsPerPage());
adapter.setDefaultSortDirection("asc");
adapter.setShowSql(false);
// get query string, then add sort Column
adapter.setSql("select * from (\n" +
output.getQuery().getQueryString(MapToInput.convertParameterMapToInputs(parameterMap,this.report))
+ ")\n"
+ " /~" + ParameterNames.sortColumn + ": ORDER BY \"[" + ParameterNames.sortColumn
+ "]\" [" + ParameterNames.sortDirection + "]~/"
);