dataStore = dataSet.getDataStore();
Assert.assertNotNull(dataStore, "The dataStore returned by loadData method of the class [" + dataSet.getClass().getName()+ "] cannot be null");
JSONObject results = new JSONObject();
try {
JSONDataWriter writer = new JSONDataWriter();
Object resultNumber = dataStore.getMetaData().getProperty("resultNumber");
if(resultNumber == null) dataStore.getMetaData().setProperty("resultNumber", new Integer((int)dataStore.getRecordsCount()));
/*
//gets the max number of rows for the table
String strRowLimit = ConsoleEngineConfig.getInstance().getProperty("CONSOLE-TABLE-ROWS-LIMIT");
int rowLimit = (strRowLimit == null)? 0 : Integer.parseInt(strRowLimit);
if (rowLimit > 0){
IDataStore tmpDS = new DataStore();
for(int index = 0; index<dataStore.getRecordsCount() && index<rowLimit; index++){
IRecord record = dataStore.getRecordAt(index);
tmpDS.appendRecord(record);
}
//set the original datastore with the new one
dataStore = tmpDS;
}
*/
JSONObject dataSetJSON = (JSONObject)writer.write(dataStore);
results = dataSetJSON;
} catch (Throwable e) {
throw new SpagoBIServiceException("Impossible to serialize datastore", e);
}