public IDataStore load(IDataReader dataReader) {
logger.debug("IN");
String data = null;
IDataStore dataStore = null;
ScriptManager sm = new ScriptManager();
if(predefinedGroovyScriptFileName!=null && !predefinedGroovyScriptFileName.equals("")){
sm.setPredefinedGroovyScriptFileName(predefinedGroovyScriptFileName);
}
if(predefinedJsScriptFileName!=null && !predefinedJsScriptFileName.equals("")){
sm.setPredefinedJsScriptFileName(predefinedJsScriptFileName);
}
try {
if(statement != null){
logger.debug("Statement "+statement);
data = sm.runScript(statement, languageScript);
}
else{
logger.debug("Use script (no parameters) "+script);
data = sm.runScript(script, languageScript);
}
// check if the result must be converted into the right xml sintax
boolean toconvert = checkSintax(data);
if(toconvert) {
data = convertResult(data);