String dataSetLabel;
String user;
String callback;
String rowId;
IDataSet dataSet;
IDataStore dataStore;
JSONObject dataSetJSON;
logger.debug("IN");
Monitor monitor =MonitorFactory.start("SpagoBI_Console.GetWarningListAction.service");
try {
super.service(request,response);
ConsoleEngineInstance consoleEngineInstance = getConsoleEngineInstance();
dataSetLabel = getAttributeAsString( DATASET_LABEL );
logger.debug("Parameter [" + DATASET_LABEL + "] is equals to [" + dataSetLabel + "]");
Assert.assertTrue(!StringUtilities.isEmpty( dataSetLabel ), "Parameter [" + DATASET_LABEL + "] cannot be null or empty");
callback = getAttributeAsString( CALLBACK );
logger.debug("Parameter [" + CALLBACK + "] is equals to [" + callback + "]");
rowId = getAttributeAsString( ID );
logger.debug("Parameter [" + ID + "] is equals to [" + rowId + "]");
Assert.assertNotNull(rowId, "Input parameters [" + ID + "] cannot be null");
dataSet = null;
try {
dataSet = getDataSet(dataSetLabel);
} catch(Throwable t) {
throw new SpagoBIServiceException("Impossible to find a dataset whose label is [" + dataSetLabel + "]", t);
}
Assert.assertNotNull(dataSet, "Impossible to find a dataset whose label is [" + dataSetLabel + "]");
/*
Map params = new HashMap();
params.put("id", rowId);
dataSet.setParamsMap(params);
*/
Map params = consoleEngineInstance.getAnalyticalDrivers();
params.put("id", rowId);
dataSet.setParamsMap(params);
dataSet.setUserProfileAttributes(UserProfileUtils.getProfileAttributes( (UserProfile) this.getEnv().get(EngineConstants.ENV_USER_PROFILE)));
Monitor monitorLD =MonitorFactory.start("SpagoBI_Console.GetWarningListAction.service.LoadData");
dataSet.loadData();
monitorLD.stop();
dataStore = dataSet.getDataStore();
Assert.assertNotNull(dataStore, "The dataStore returned by loadData method of the class [" + dataSet.getClass().getName()+ "] cannot be null");
dataStore.getMetaData().setProperty("detailProperty", ERRORS_DETAIL_COLUMN);
//int fieldIndex = dataStore.getMetaData().getFieldIndex(ERRORS_DETAIL_COLUMN);
//dataStore.getMetaData().getFieldMeta(fieldIndex).setProperty("detail", true);