some not useful code commented removed in servlet
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/databases-manager-portlet@99790 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
5386131130
commit
9528ed747c
|
@ -83,113 +83,37 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
public static List<String> listAlgorithms;
|
||||
|
||||
public GWTdbManagerServiceImpl() throws Exception {
|
||||
|
||||
// create the cache
|
||||
// CacheManager cacheManager;
|
||||
// ClassLoader contextClassLoader =
|
||||
// Thread.currentThread().getContextClassLoader();
|
||||
// InputStream resourceAsStream =
|
||||
// contextClassLoader.getResourceAsStream("ehcache.xml");
|
||||
// cacheManager = CacheManager.create(resourceAsStream);
|
||||
|
||||
// TODO: DA MODIFICARE LA MODALITÀ DI RECUPERO DEL FILE
|
||||
// try {
|
||||
//
|
||||
// // CacheManager cacheManager = CacheManager
|
||||
// //
|
||||
// .newInstance("/home/loredana/workspace/databases-manager-portlet-TRUNK/configCache/encache.xml");
|
||||
//
|
||||
// // InputStream is =
|
||||
// // ClassLoader.getSystemResourceAsStream("encache.xml");
|
||||
// // CacheManager cacheManager = CacheManager.newInstance(is);
|
||||
// // is.close();
|
||||
//
|
||||
// URL url = getClass().getResource("/encache.xml");
|
||||
// CacheManager cacheManager = CacheManager.newInstance(url);
|
||||
// // getcache
|
||||
// employeeCache = cacheManager.getEhcache("DBCache");
|
||||
//
|
||||
// //set Disk Store Path in the configuration file encache.xml
|
||||
// // CacheConfiguration config = employeeCache.getCacheConfiguration();
|
||||
// // String DiskCacheFolderName="DBManagerDisk";
|
||||
// ////
|
||||
// config.setDiskStorePath(this.getServletContext().getRealPath("")+DiskCacheFolderName);
|
||||
// //
|
||||
// //
|
||||
// config.setDiskStorePath(this.getServletContext().getRealPath("")+DiskCacheFolderName);
|
||||
//
|
||||
// } catch (Exception e) {
|
||||
// // TODO: handle exception
|
||||
// e.printStackTrace();
|
||||
// throw new Exception("Failed to get cache. " + e);
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() throws ServletException {
|
||||
|
||||
super.init();
|
||||
|
||||
// //build the list of available algorithms
|
||||
// listAlgorithms.add("LISTDBNAMES");
|
||||
// listAlgorithms.add("LISTDBINFO");
|
||||
// listAlgorithms.add("LISTDBSCHEMA");
|
||||
// listAlgorithms.add("LISTTABLES");
|
||||
// listAlgorithms.add("GETTABLEDETAILS");
|
||||
// listAlgorithms.add("SUBMITQUERY");
|
||||
// listAlgorithms.add("SAMPLEONTABLE");
|
||||
// listAlgorithms.add("SMARTSAMPLEONTABLE");
|
||||
// listAlgorithms.add("RANDOMSAMPLEONTABLE");
|
||||
|
||||
|
||||
//craete cache
|
||||
try {
|
||||
|
||||
// CacheManager cacheManager = CacheManager
|
||||
// .newInstance("/home/loredana/workspace/databases-manager-portlet-TRUNK/configCache/encache.xml");
|
||||
|
||||
// InputStream is =
|
||||
// ClassLoader.getSystemResourceAsStream("encache.xml");
|
||||
// CacheManager cacheManager = CacheManager.newInstance(is);
|
||||
// is.close();
|
||||
|
||||
URL url = getClass().getResource("/encache.xml");
|
||||
CacheManager cacheManager = CacheManager.newInstance(url);
|
||||
// getcache
|
||||
employeeCache = cacheManager.getEhcache("DBCache");
|
||||
|
||||
// set Disk Store Path in the configuration file encache.xml
|
||||
// CacheConfiguration config =
|
||||
// employeeCache.getCacheConfiguration();
|
||||
// String DiskCacheFolderName="DBManagerDisk";
|
||||
// //
|
||||
// config.setDiskStorePath(this.getServletContext().getRealPath("")+DiskCacheFolderName);
|
||||
//
|
||||
// config.setDiskStorePath(this.getServletContext().getRealPath("")+DiskCacheFolderName);
|
||||
|
||||
String path = System.getenv("CATALINA_TMPDIR");
|
||||
System.out.println("Path: " +
|
||||
this.getServletContext().getRealPath(""));
|
||||
|
||||
// System.out.println("Path: " + path);
|
||||
|
||||
// create folder for caching data
|
||||
// String DiskCacheFolderName="DBManagerDisk";
|
||||
// File f = new
|
||||
// File(this.getServletContext().getRealPath("")+DiskCacheFolderName);
|
||||
// System.out.println("Path: " +
|
||||
// this.getServletContext().getRealPath(""));
|
||||
|
||||
|
||||
CacheConfiguration config = employeeCache.getCacheConfiguration();
|
||||
String DiskCacheFolderName = "DBManagerDisk";
|
||||
// config.setDiskStorePath(this.getServletContext().getRealPath("")+DiskCacheFolderName);
|
||||
|
||||
|
||||
// File f = new File(path+"/"+DiskCacheFolderName);
|
||||
|
||||
// if (!f.exists()){
|
||||
// f.mkdir();
|
||||
//
|
||||
// }
|
||||
|
||||
// config.setDiskStorePath(path+"/"+DiskCacheFolderName);
|
||||
|
||||
config.setDiskStorePath(path);
|
||||
// config.setDiskPersistent(true);
|
||||
// config.setOverflowToDisk(true);
|
||||
|
@ -260,47 +184,17 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
// data output
|
||||
List<FileModel> outputParameters = new ArrayList<FileModel>();
|
||||
|
||||
// if (listAlgorithms==null){
|
||||
// // get list of algorithms
|
||||
//// List<String> algorithms = new ArrayList<String>();
|
||||
//// algorithms = getDatabaseManagerAlgorithms();
|
||||
//
|
||||
// listAlgorithms = getDatabaseManagerAlgorithms();
|
||||
//
|
||||
// }
|
||||
// get algorithmId
|
||||
String algorithmId = "LISTDBNAMES";
|
||||
|
||||
// for (int i = 0; i < listAlgorithms.size(); i++) {
|
||||
// if (listAlgorithms.get(i).equals("LISTDBNAMES")) {
|
||||
// algorithmId = listAlgorithms.get(i);
|
||||
// // print check
|
||||
// // logger.info("algorithmId: " + algorithmId);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// get input parameters of the algorithm specified by id
|
||||
// inputParameters = getParameters(algorithmId);
|
||||
|
||||
Parameter maxNumber = new Parameter("MaxNumber", "", "String", "-1");
|
||||
inputParameters.add(maxNumber);
|
||||
|
||||
// if (inputParameters.size() != 0) {
|
||||
// print check
|
||||
// logger.info("dbmanager-> algorithm input parameters retrieved");
|
||||
|
||||
// // print check input parameters
|
||||
// for (int i = 0; i < inputParameters.size(); i++) {
|
||||
// logger.info(inputParameters.get(i).getName());
|
||||
// }
|
||||
|
||||
// check if the value is in cache. If data does not exist in cache
|
||||
// the computation is started otherwise data are retrieved from
|
||||
// cache.
|
||||
|
||||
|
||||
|
||||
try {
|
||||
|
||||
// get data from cache
|
||||
|
@ -377,40 +271,12 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
List<Parameter> inputParameters = new ArrayList<Parameter>();
|
||||
// data output
|
||||
LinkedHashMap<String, FileModel> outputParameters = new LinkedHashMap<String, FileModel>();
|
||||
|
||||
// get list of algorithms
|
||||
// List<String> algorithms = new ArrayList<String>();
|
||||
// algorithms = getDatabaseManagerAlgorithms();
|
||||
|
||||
// if (listAlgorithms==null){
|
||||
// listAlgorithms = getDatabaseManagerAlgorithms();
|
||||
// }
|
||||
//
|
||||
// // get algorithmId
|
||||
// String algorithmId = null;
|
||||
//
|
||||
// for (int i = 0; i < listAlgorithms.size(); i++) {
|
||||
// if (listAlgorithms.get(i).equals("LISTDBINFO")) {
|
||||
// algorithmId = listAlgorithms.get(i);
|
||||
// // print check
|
||||
// // logger.info("algorithmId: " + algorithmId);
|
||||
// }
|
||||
// }
|
||||
|
||||
// get input parameters of the algorithm specified by id
|
||||
// inputParameters = getParameters(algorithmId);
|
||||
|
||||
// if (inputParameters.size() != 0) {
|
||||
// print check
|
||||
// logger.info("dbmanager-> algorithm input parameters retrieved");
|
||||
|
||||
String algorithmId = "LISTDBINFO";
|
||||
|
||||
//print check
|
||||
logger.info("dbmanager-> ResourceName: "
|
||||
+ resourceName);
|
||||
|
||||
// if (!resourceName.equals("")){
|
||||
|
||||
Parameter resource = new Parameter("ResourceName", "", "String", "");
|
||||
inputParameters.add(resource);
|
||||
|
@ -481,10 +347,7 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
insertDataIntoCache(dataToCache);
|
||||
// employeeCache.put(dataToCache);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
|
@ -492,17 +355,6 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
e.printStackTrace();
|
||||
throw new Exception("Failed to load data. " + e);
|
||||
}
|
||||
|
||||
// }
|
||||
|
||||
// inputParameters.get(0).setValue(resourceName);
|
||||
|
||||
// print check
|
||||
// logger.info(inputParameters.get(0).getName());
|
||||
|
||||
|
||||
|
||||
// }
|
||||
|
||||
return outputParameters;
|
||||
}
|
||||
|
@ -517,28 +369,6 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
// data output
|
||||
List<FileModel> outputParameters = new ArrayList<FileModel>();
|
||||
|
||||
// get list of algorithms
|
||||
// List<String> algorithms = new ArrayList<String>();
|
||||
// algorithms = getDatabaseManagerAlgorithms();
|
||||
|
||||
// if (listAlgorithms==null){
|
||||
// listAlgorithms = getDatabaseManagerAlgorithms();
|
||||
// }
|
||||
//
|
||||
// // get algorithmId
|
||||
// String algorithmId = null;
|
||||
//
|
||||
// for (int i = 0; i < listAlgorithms.size(); i++) {
|
||||
// if (listAlgorithms.get(i).equals("LISTDBSCHEMA")) {
|
||||
// algorithmId = listAlgorithms.get(i);
|
||||
// // print check
|
||||
// // logger.info("algorithmId: " + algorithmId);
|
||||
// }
|
||||
// }
|
||||
|
||||
// get input parameters of the algorithm specified by id
|
||||
// inputParameters = getParameters(algorithmId);
|
||||
|
||||
String algorithmId = "LISTDBSCHEMA";
|
||||
// print check
|
||||
String rs = dataInput.get("ResourceName");
|
||||
|
@ -548,15 +378,7 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
+ rs);
|
||||
logger.info("dbmanager-> DatabaseName: "
|
||||
+ db);
|
||||
|
||||
|
||||
|
||||
// if (inputParameters.size() != 0) {
|
||||
// print check
|
||||
// logger.info("dbmanager-> algorithm input parameters retrieved");
|
||||
|
||||
// if ((!rs.equals(""))&&(!db.equals(""))){
|
||||
|
||||
//set input parameters
|
||||
Parameter resource = new Parameter("ResourceName", "", "String", "");
|
||||
Parameter database = new Parameter("DatabaseName", "", "String", "");
|
||||
|
@ -588,8 +410,7 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
if (value != null) {
|
||||
outputParameters = (List<FileModel>) value;
|
||||
} else {
|
||||
|
||||
// if (algorithmId!=null){
|
||||
|
||||
// start the computation
|
||||
// create data structure
|
||||
ComputationOutput outputData = new ComputationOutput();
|
||||
|
@ -629,9 +450,6 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
insertDataIntoCache(dataToCache);
|
||||
// employeeCache.put(dataToCache);
|
||||
}
|
||||
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -641,12 +459,7 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
throw new Exception("Failed to load data. " + e);
|
||||
|
||||
}
|
||||
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// }
|
||||
return outputParameters;
|
||||
}
|
||||
|
||||
|
@ -658,38 +471,7 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
// data output
|
||||
List<Result> outputParameters = new ArrayList<Result>();
|
||||
|
||||
// get list of algorithms
|
||||
// List<String> algorithms = new ArrayList<String>();
|
||||
// algorithms = getDatabaseManagerAlgorithms();
|
||||
|
||||
// if (listAlgorithms==null){
|
||||
// listAlgorithms = getDatabaseManagerAlgorithms();
|
||||
// }
|
||||
//
|
||||
// // get algorithmId
|
||||
// String algorithmId = null;
|
||||
//
|
||||
// for (int i = 0; i < listAlgorithms.size(); i++) {
|
||||
// if (listAlgorithms.get(i).equals("LISTTABLES")) {
|
||||
// algorithmId = listAlgorithms.get(i);
|
||||
// // print check
|
||||
// // logger.info("algorithmId: " + algorithmId);
|
||||
// }
|
||||
// }
|
||||
|
||||
// get input parameters of the algorithm
|
||||
// inputParameters = getParameters(algorithmId);
|
||||
|
||||
// if (inputParameters.size() != 0) {
|
||||
// // print check
|
||||
// logger.info("dbmanager-> algorithm input parameters retrieved");
|
||||
// }
|
||||
|
||||
// print check algorithm input parameters
|
||||
// for (int i = 0; i < inputParameters.size(); i++) {
|
||||
// logger.info(inputParameters.get(i).getName());
|
||||
// }
|
||||
|
||||
|
||||
String algorithmId = "LISTTABLES";
|
||||
|
||||
String rs= dataInput.get("ResourceName");
|
||||
|
@ -704,8 +486,6 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
logger.info("dbmanager-> SchemaName: "
|
||||
+ scm);
|
||||
|
||||
// if ((!rs.equals(""))&&(!db.equals(""))){
|
||||
|
||||
//set input parameters
|
||||
Parameter resource = new Parameter("ResourceName", "", "String", "");
|
||||
Parameter database = new Parameter("DatabaseName", "", "String", "");
|
||||
|
@ -741,45 +521,7 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
.valueOf(i)));
|
||||
outputParameters.add(row);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// }
|
||||
|
||||
// inputParameters.get(0).setValue(dataInput.get("ResourceName"));
|
||||
// inputParameters.get(1).setValue(dataInput.get("DatabaseName"));
|
||||
// inputParameters.get(2).setValue(dataInput.get("SchemaName"));
|
||||
|
||||
// // print check
|
||||
// logger.info("dbmanager-> ResourceName: "
|
||||
// + dataInput.get("ResourceName"));
|
||||
// logger.info("dbmanager-> DatabaseName: "
|
||||
// + dataInput.get("DatabaseName"));
|
||||
// logger.info("dbmanager-> SchemaName: " + dataInput.get("SchemaName"));
|
||||
|
||||
// // create data structure
|
||||
// ComputationOutput outputData = new ComputationOutput();
|
||||
// // computation id
|
||||
// String computationId = startComputation(algorithmId, inputParameters,
|
||||
// outputData);
|
||||
//
|
||||
// // print check on retrieving data
|
||||
// // logger.info("output data retrieved");
|
||||
//
|
||||
// // data output values
|
||||
// LinkedHashMap<String, String> mapValues = new LinkedHashMap<String, String>();
|
||||
// // data output keys
|
||||
// LinkedHashMap<String, String> mapKeys = new LinkedHashMap<String, String>();
|
||||
//
|
||||
// mapValues = outputData.getMapValues();
|
||||
// mapKeys = outputData.getmapKeys();
|
||||
//
|
||||
// for (int i = 0; i < mapValues.size(); i++) {
|
||||
// Result row = new Result(String.valueOf(i), mapValues.get(String
|
||||
// .valueOf(i)));
|
||||
// outputParameters.add(row);
|
||||
// }
|
||||
return outputParameters;
|
||||
}
|
||||
|
||||
|
@ -901,39 +643,7 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
// list that contains table attributes
|
||||
List<String> listAttributes = null;
|
||||
|
||||
// get list of algorithms
|
||||
// List<String> algorithms = new ArrayList<String>();
|
||||
// algorithms = getDatabaseManagerAlgorithms();
|
||||
|
||||
// if (listAlgorithms==null){
|
||||
// listAlgorithms = getDatabaseManagerAlgorithms();
|
||||
// }
|
||||
//
|
||||
// // get algorithmId
|
||||
// String algorithmId = null;
|
||||
//
|
||||
// for (int i = 0; i < listAlgorithms.size(); i++) {
|
||||
// if (listAlgorithms.get(i).equals("SUBMITQUERY")) {
|
||||
// algorithmId = listAlgorithms.get(i);
|
||||
// // print check
|
||||
// // logger.info("algorithmId: " + algorithmId);
|
||||
// }
|
||||
// }
|
||||
|
||||
// // get input parameters of the algorithm
|
||||
// inputParameters = getParameters(algorithmId);
|
||||
//
|
||||
// if (inputParameters.size() != 0) {
|
||||
// // print check
|
||||
// logger.info("dbmanager-> algorithm input parameters retrieved");
|
||||
// }
|
||||
|
||||
// print check
|
||||
// for (int i = 0; i < inputParameters.size(); i++) {
|
||||
// logger.info(inputParameters.get(i).getName());
|
||||
// }
|
||||
|
||||
|
||||
|
||||
String algorithmId = "SUBMITQUERY";
|
||||
|
||||
// print check
|
||||
|
@ -947,15 +657,11 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
logger.info("dbmanager-> DatabaseName: "
|
||||
+ db);
|
||||
|
||||
// logger.info("dbmanager-> ResourceName: " + dataDB.get("ResourceName"));
|
||||
// logger.info("dbmanager-> DatabaseName: " + dataDB.get("DatabaseName"));
|
||||
logger.info("dbmanager-> Query: " + query);
|
||||
logger.info("dbmanager-> SmartCorrections check: "
|
||||
+ smartCorrectionQuery);
|
||||
|
||||
// if ((!rs.equals(""))&&(!db.equals(""))){
|
||||
|
||||
//set input parameters
|
||||
|
||||
Parameter resource = new Parameter("ResourceName", "", "String", "");
|
||||
Parameter database = new Parameter("DatabaseName", "", "String", "");
|
||||
Parameter readOnlyQuery = new Parameter("Read-Only Query", "", "Boolean", "true");
|
||||
|
@ -1038,17 +744,6 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
}
|
||||
throw e;
|
||||
}
|
||||
|
||||
|
||||
// }
|
||||
|
||||
// inputParameters.get(0).setValue(dataDB.get("ResourceName"));
|
||||
// inputParameters.get(1).setValue(dataDB.get("DatabaseName"));
|
||||
// inputParameters.get(2).setValue(String.valueOf(valueReadOnlyQuery));
|
||||
// inputParameters.get(3).setValue(String.valueOf(smartCorrectionQuery));
|
||||
// inputParameters.get(4).setValue(language);
|
||||
// inputParameters.get(5).setValue(query);
|
||||
|
||||
|
||||
return listAttributes;
|
||||
}
|
||||
|
@ -1061,33 +756,6 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
// output sample result
|
||||
List<Result> output = new ArrayList<Result>();
|
||||
|
||||
// // get list of algorithms
|
||||
// List<String> algorithms = new ArrayList<String>();
|
||||
// algorithms = getDatabaseManagerAlgorithms();
|
||||
//
|
||||
// // get algorithmId
|
||||
//// String algorithmId = null;
|
||||
//
|
||||
// for (int i = 0; i < algorithms.size(); i++) {
|
||||
// if (algorithms.get(i).equals("SAMPLEONTABLE")) {
|
||||
// algorithmId = algorithms.get(i);
|
||||
// // print check
|
||||
// // logger.info("algorithmId: " + algorithmId);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // get input parameters of the algorithm specified by id
|
||||
// inputParameters = getParameters(algorithmId);
|
||||
//
|
||||
// if (inputParameters.size() != 0) {
|
||||
// // print check
|
||||
// logger.info("dbmanager-> algorithm input parameters retrieved");
|
||||
// }
|
||||
|
||||
// print check
|
||||
// for (int i = 0; i < inputParameters.size(); i++) {
|
||||
// logger.info(inputParameters.get(i).getName());
|
||||
// }
|
||||
|
||||
String algorithmId = "SAMPLEONTABLE";
|
||||
|
||||
|
@ -1106,8 +774,6 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
+ scm);
|
||||
logger.info("dbmanager-> TableName: "
|
||||
+ tab);
|
||||
|
||||
// if ((!rs.equals(""))&&(!db.equals(""))&&(!scm.equals(""))&&(!tab.equals(""))){
|
||||
|
||||
//set input parameters
|
||||
Parameter resource = new Parameter("ResourceName", "", "String", "");
|
||||
|
@ -1147,25 +813,7 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
mapValues.get(String.valueOf(i)));
|
||||
output.add(row);
|
||||
}
|
||||
|
||||
|
||||
// }
|
||||
|
||||
|
||||
// // print check
|
||||
// logger.info("dbmanager-> ResourceName: "
|
||||
// + dataInput.get("ResourceName"));
|
||||
// logger.info("dbmanager-> DatabaseName: "
|
||||
// + dataInput.get("DatabaseName"));
|
||||
// logger.info("dbmanager-> SchemaName: " + dataInput.get("SchemaName"));
|
||||
// logger.info("dbmanager-> TableName: " + dataInput.get("TableName"));
|
||||
|
||||
// inputParameters.get(0).setValue(dataInput.get("ResourceName"));
|
||||
// inputParameters.get(1).setValue(dataInput.get("DatabaseName"));
|
||||
// inputParameters.get(2).setValue(dataInput.get("SchemaName"));
|
||||
// inputParameters.get(3).setValue(dataInput.get("TableName"));
|
||||
|
||||
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
|
@ -1176,34 +824,6 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
List<Parameter> inputParameters = new ArrayList<Parameter>();
|
||||
// output sample result
|
||||
List<Result> output = new ArrayList<Result>();
|
||||
|
||||
// // get list of algorithms
|
||||
// List<String> algorithms = new ArrayList<String>();
|
||||
// algorithms = getDatabaseManagerAlgorithms();
|
||||
//
|
||||
// // get algorithmId
|
||||
//// String algorithmId = null;
|
||||
//
|
||||
// for (int i = 0; i < algorithms.size(); i++) {
|
||||
// if (algorithms.get(i).equals("SMARTSAMPLEONTABLE")) {
|
||||
// algorithmId = algorithms.get(i);
|
||||
// // print check
|
||||
// // logger.info("algorithmId: " + algorithmId);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // get input parameters of the algorithm
|
||||
// inputParameters = getParameters(algorithmId);
|
||||
//
|
||||
// if (inputParameters.size() != 0) {
|
||||
// // print check
|
||||
// logger.info("dbmanager-> algorithm input parameters retrieved");
|
||||
// }
|
||||
|
||||
// print check
|
||||
// for (int i = 0; i < inputParameters.size(); i++) {
|
||||
// logger.info(inputParameters.get(i).getName());
|
||||
// }
|
||||
|
||||
String algorithmId = "SMARTSAMPLEONTABLE";
|
||||
|
||||
|
@ -1223,8 +843,6 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
logger.info("dbmanager-> TableName: "
|
||||
+ tab);
|
||||
|
||||
// if ((!rs.equals(""))&&(!db.equals(""))&&(!scm.equals(""))&&(!tab.equals(""))){
|
||||
|
||||
//set input parameters
|
||||
Parameter resource = new Parameter("ResourceName", "", "String", "");
|
||||
Parameter database = new Parameter("DatabaseName", "", "String", "");
|
||||
|
@ -1262,45 +880,7 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
mapValues.get(String.valueOf(i)));
|
||||
output.add(row);
|
||||
}
|
||||
|
||||
// }
|
||||
|
||||
|
||||
// // print check
|
||||
// logger.info("dbmanager-> ResourceName: "
|
||||
// + dataInput.get("ResourceName"));
|
||||
// logger.info("dbmanager-> DatabaseName: "
|
||||
// + dataInput.get("DatabaseName"));
|
||||
// logger.info("dbmanager-> SchemaName: " + dataInput.get("SchemaName"));
|
||||
// logger.info("dbmanager-> TableName: " + dataInput.get("TableName"));
|
||||
//
|
||||
// inputParameters.get(0).setValue(dataInput.get("ResourceName"));
|
||||
// inputParameters.get(1).setValue(dataInput.get("DatabaseName"));
|
||||
// inputParameters.get(2).setValue(dataInput.get("SchemaName"));
|
||||
// inputParameters.get(3).setValue(dataInput.get("TableName"));
|
||||
|
||||
// // create data structure
|
||||
// ComputationOutput outputData = new ComputationOutput();
|
||||
// // computation id
|
||||
// String computationId = startComputation(algorithmId, inputParameters,
|
||||
// outputData);
|
||||
//
|
||||
// // print check on retrieving data
|
||||
// // logger.info("dbmanager-> output data retrieved");
|
||||
//
|
||||
// // data output values
|
||||
// LinkedHashMap<String, String> mapValues = new LinkedHashMap<String, String>();
|
||||
// // data output keys
|
||||
// LinkedHashMap<String, String> mapKeys = new LinkedHashMap<String, String>();
|
||||
//
|
||||
// mapValues = outputData.getMapValues();
|
||||
// mapKeys = outputData.getmapKeys();
|
||||
//
|
||||
// for (int i = 0; i < mapValues.size(); i++) {
|
||||
// Result row = new Result(mapKeys.get(String.valueOf(i)),
|
||||
// mapValues.get(String.valueOf(i)));
|
||||
// output.add(row);
|
||||
// }
|
||||
return output;
|
||||
}
|
||||
|
||||
|
@ -1312,34 +892,6 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
List<Parameter> inputParameters = new ArrayList<Parameter>();
|
||||
// output sample result
|
||||
List<Result> output = new ArrayList<Result>();
|
||||
|
||||
// // get list of algorithms
|
||||
// List<String> algorithms = new ArrayList<String>();
|
||||
// algorithms = getDatabaseManagerAlgorithms();
|
||||
//
|
||||
// // get algorithmId
|
||||
//// String algorithmId = null;
|
||||
//
|
||||
// for (int i = 0; i < algorithms.size(); i++) {
|
||||
// if (algorithms.get(i).equals("RANDOMSAMPLEONTABLE")) {
|
||||
// algorithmId = algorithms.get(i);
|
||||
// // print check
|
||||
// // logger.info("algorithmId: " + algorithmId);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // get input parameters of the algorithm specified by id
|
||||
// inputParameters = getParameters(algorithmId);
|
||||
//
|
||||
// if (inputParameters.size() != 0) {
|
||||
// // print check
|
||||
// logger.info("dbmanager-> algorithm input parameters retrieved");
|
||||
// }
|
||||
|
||||
// print check algorithm input parameters
|
||||
// for (int i = 0; i < inputParameters.size(); i++) {
|
||||
// logger.info(inputParameters.get(i).getName());
|
||||
// }
|
||||
|
||||
String algorithmId = "RANDOMSAMPLEONTABLE";
|
||||
|
||||
|
@ -1358,10 +910,7 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
+ scm);
|
||||
logger.info("dbmanager-> TableName: "
|
||||
+ tab);
|
||||
|
||||
|
||||
// if ((!rs.equals(""))&&(!db.equals(""))&&(!scm.equals(""))&&(!tab.equals(""))){
|
||||
|
||||
|
||||
//set input parameters
|
||||
Parameter resource = new Parameter("ResourceName", "", "String", "");
|
||||
Parameter database = new Parameter("DatabaseName", "", "String", "");
|
||||
|
@ -1399,44 +948,7 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
mapValues.get(String.valueOf(i)));
|
||||
output.add(row);
|
||||
}
|
||||
|
||||
// }
|
||||
|
||||
// // print check
|
||||
// logger.info("dbmanager-> ResourceName: "
|
||||
// + dataInput.get("ResourceName"));
|
||||
// logger.info("dbmanager-> DatabaseName: "
|
||||
// + dataInput.get("DatabaseName"));
|
||||
// logger.info("dbmanager-> SchemaName: " + dataInput.get("SchemaName"));
|
||||
// logger.info("dbmanager-> TableName: " + dataInput.get("TableName"));
|
||||
//
|
||||
// inputParameters.get(0).setValue(dataInput.get("ResourceName"));
|
||||
// inputParameters.get(1).setValue(dataInput.get("DatabaseName"));
|
||||
// inputParameters.get(2).setValue(dataInput.get("SchemaName"));
|
||||
// inputParameters.get(3).setValue(dataInput.get("TableName"));
|
||||
|
||||
// // create data structure
|
||||
// ComputationOutput outputData = new ComputationOutput();
|
||||
// // computation id
|
||||
// String computationId = startComputation(algorithmId, inputParameters,
|
||||
// outputData);
|
||||
//
|
||||
// // print check on retrieving data
|
||||
// // logger.info("dbmanager-> output data retrieved");
|
||||
//
|
||||
// // data output values
|
||||
// LinkedHashMap<String, String> mapValues = new LinkedHashMap<String, String>();
|
||||
// // data output keys
|
||||
// LinkedHashMap<String, String> mapKeys = new LinkedHashMap<String, String>();
|
||||
//
|
||||
// mapValues = outputData.getMapValues();
|
||||
// mapKeys = outputData.getmapKeys();
|
||||
//
|
||||
// for (int i = 0; i < mapValues.size(); i++) {
|
||||
// Result row = new Result(mapKeys.get(String.valueOf(i)),
|
||||
// mapValues.get(String.valueOf(i)));
|
||||
// output.add(row);
|
||||
// }
|
||||
return output;
|
||||
}
|
||||
|
||||
|
@ -1448,33 +960,6 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
// data ouptut
|
||||
LinkedHashMap<String, FileModel> outputParameters = new LinkedHashMap<String, FileModel>();
|
||||
|
||||
// // get list of algorithms
|
||||
// List<String> algorithms = new ArrayList<String>();
|
||||
// algorithms = getDatabaseManagerAlgorithms();
|
||||
//
|
||||
// // get algorithmId
|
||||
// String algorithmId = null;
|
||||
//
|
||||
// for (int i = 0; i < algorithms.size(); i++) {
|
||||
// if (algorithms.get(i).equals("GETTABLEDETAILS")) {
|
||||
// algorithmId = algorithms.get(i);
|
||||
// // print check
|
||||
// // logger.info("algorithmId: " + algorithmId);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // get input parameters of the algorithm specified by id
|
||||
// inputParameters = getParameters(algorithmId);
|
||||
//
|
||||
// if (inputParameters.size() != 0) {
|
||||
// // print check
|
||||
// logger.info("dbmanager-> algorithm input parameters retrieved");
|
||||
// }
|
||||
|
||||
// print check algorithm input parameters
|
||||
// for (int i = 0; i < inputParameters.size(); i++) {
|
||||
// logger.info(inputParameters.get(i).getName());
|
||||
// }
|
||||
String algorithmId = "GETTABLEDETAILS";
|
||||
|
||||
//print check
|
||||
|
@ -1494,8 +979,6 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
+ tab);
|
||||
|
||||
|
||||
// if ((!rs.equals(""))&&(!db.equals(""))&&(!scm.equals(""))&&(!tab.equals(""))){
|
||||
|
||||
//set input parameters
|
||||
Parameter resource = new Parameter("ResourceName", "", "String", "");
|
||||
Parameter database = new Parameter("DatabaseName", "", "String", "");
|
||||
|
@ -1537,47 +1020,7 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
// logger.info("value: " + outputMap.get(String.valueOf(i)));
|
||||
// logger.info("key: " + outputKey.get(String.valueOf(i)));
|
||||
}
|
||||
|
||||
// }
|
||||
|
||||
// // print check
|
||||
// logger.info("dbmanager-> ResourceName: "
|
||||
// + dataInput.get("ResourceName"));
|
||||
// logger.info("dbmanager-> DatabaseName: "
|
||||
// + dataInput.get("DatabaseName"));
|
||||
// logger.info("dbmanager-> SchemaName: " + dataInput.get("SchemaName"));
|
||||
// logger.info("dbmanager-> TableName: " + dataInput.get("TableName"));
|
||||
//
|
||||
// inputParameters.get(0).setValue(dataInput.get("ResourceName"));
|
||||
// inputParameters.get(1).setValue(dataInput.get("DatabaseName"));
|
||||
// inputParameters.get(2).setValue(dataInput.get("SchemaName"));
|
||||
// inputParameters.get(3).setValue(dataInput.get("TableName"));
|
||||
|
||||
// // create data structure
|
||||
// ComputationOutput outputData = new ComputationOutput();
|
||||
// // computation id
|
||||
// String computationId = startComputation(algorithmId, inputParameters,
|
||||
// outputData);
|
||||
//
|
||||
// // print check on retrieving data
|
||||
// // logger.info("output data retrieved");
|
||||
//
|
||||
// // output data values
|
||||
// LinkedHashMap<String, String> mapValues = new LinkedHashMap<String, String>();
|
||||
// // output data keys
|
||||
// LinkedHashMap<String, String> mapKeys = new LinkedHashMap<String, String>();
|
||||
//
|
||||
// mapValues = outputData.getMapValues();
|
||||
// mapKeys = outputData.getmapKeys();
|
||||
//
|
||||
// for (int i = 0; i < mapValues.size(); i++) {
|
||||
// FileModel obj = new FileModel(mapValues.get(String.valueOf(i)));
|
||||
// // obj.setIsLoaded(true);
|
||||
// outputParameters.put(mapKeys.get(String.valueOf(i)), obj);
|
||||
// // print check
|
||||
// // logger.info("value: " + outputMap.get(String.valueOf(i)));
|
||||
// // logger.info("key: " + outputKey.get(String.valueOf(i)));
|
||||
// }
|
||||
return outputParameters;
|
||||
}
|
||||
|
||||
|
@ -1724,53 +1167,55 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
return elements;
|
||||
}
|
||||
|
||||
private List<String> getDatabaseManagerAlgorithms() {
|
||||
ArrayList<String> dbAlg = new ArrayList<String>();
|
||||
StatisticalManagerFactory factory = getFactory();
|
||||
// get and print algorithms
|
||||
SMListGroupedAlgorithms groups = factory.getAlgorithms();
|
||||
//not called
|
||||
// private List<String> getDatabaseManagerAlgorithms() {
|
||||
// ArrayList<String> dbAlg = new ArrayList<String>();
|
||||
// StatisticalManagerFactory factory = getFactory();
|
||||
// // get and print algorithms
|
||||
// SMListGroupedAlgorithms groups = factory.getAlgorithms();
|
||||
//
|
||||
// if (groups == null)
|
||||
// logger.info("dbmanager-> GROUPS OF ALGORITHMS IS NULL!");
|
||||
// else
|
||||
// logger.info("dbmanager-> GROUPS OF ALGORITHMS IS NOT NULL!");
|
||||
//
|
||||
// // get list categories
|
||||
// for (SMGroupedAlgorithms group : groups.thelist()) {
|
||||
// for (SMAlgorithm algorithm : group.thelist()) {
|
||||
// dbAlg.add(algorithm.name());
|
||||
// }
|
||||
// }
|
||||
// return dbAlg;
|
||||
// }
|
||||
|
||||
if (groups == null)
|
||||
logger.info("dbmanager-> GROUPS OF ALGORITHMS IS NULL!");
|
||||
else
|
||||
logger.info("dbmanager-> GROUPS OF ALGORITHMS IS NOT NULL!");
|
||||
|
||||
// get list categories
|
||||
for (SMGroupedAlgorithms group : groups.thelist()) {
|
||||
for (SMAlgorithm algorithm : group.thelist()) {
|
||||
dbAlg.add(algorithm.name());
|
||||
}
|
||||
}
|
||||
return dbAlg;
|
||||
}
|
||||
|
||||
private List<Parameter> getParameters(String algorithmId) {
|
||||
StatisticalManagerFactory factory = getFactory();
|
||||
SMParameters smParams = factory.getAlgorithmParameters(algorithmId);
|
||||
List<Parameter> params = new ArrayList<Parameter>();
|
||||
|
||||
for (SMParameter smParam : smParams.list()) {
|
||||
SMTypeParameter smType = smParam.type();
|
||||
StatisticalServiceType smTypeName = smType.name();
|
||||
|
||||
String paramName = smParam.name();
|
||||
String paramDescription = smParam.description();
|
||||
String defaultValue = smParam.defaultValue();
|
||||
String objectType = smType.values().get(0);
|
||||
|
||||
// print CHECK
|
||||
logger.info("parameters: ");
|
||||
logger.info(paramName);
|
||||
logger.info(paramDescription);
|
||||
logger.info(objectType);
|
||||
logger.info(defaultValue);
|
||||
|
||||
Parameter objectParam = new Parameter(paramName, paramDescription,
|
||||
objectType, defaultValue);
|
||||
params.add(objectParam);
|
||||
}
|
||||
return params;
|
||||
}
|
||||
//not used
|
||||
// private List<Parameter> getParameters(String algorithmId) {
|
||||
// StatisticalManagerFactory factory = getFactory();
|
||||
// SMParameters smParams = factory.getAlgorithmParameters(algorithmId);
|
||||
// List<Parameter> params = new ArrayList<Parameter>();
|
||||
//
|
||||
// for (SMParameter smParam : smParams.list()) {
|
||||
// SMTypeParameter smType = smParam.type();
|
||||
// StatisticalServiceType smTypeName = smType.name();
|
||||
//
|
||||
// String paramName = smParam.name();
|
||||
// String paramDescription = smParam.description();
|
||||
// String defaultValue = smParam.defaultValue();
|
||||
// String objectType = smType.values().get(0);
|
||||
//
|
||||
// // print CHECK
|
||||
//// logger.info("parameters: ");
|
||||
//// logger.info(paramName);
|
||||
//// logger.info(paramDescription);
|
||||
//// logger.info(objectType);
|
||||
//// logger.info(defaultValue);
|
||||
//
|
||||
// Parameter objectParam = new Parameter(paramName, paramDescription,
|
||||
// objectType, defaultValue);
|
||||
// params.add(objectParam);
|
||||
// }
|
||||
// return params;
|
||||
// }
|
||||
|
||||
private synchronized List<Result> getSubmitQueryResult(String submitQueryUID) {
|
||||
ASLSession session = WsUtil.getAslSession(this.getThreadLocalRequest()
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
<inherits name='com.extjs.gxt.ui.GXT' />
|
||||
|
||||
<inherits name="com.google.gwt.logging.Logging"/>
|
||||
<!-- <inherits name="com.google.gwt.logging.Logging"/> -->
|
||||
|
||||
<!-- We need the JUnit module in the main module, -->
|
||||
<!-- otherwise eclipse complains (Google plugin bug?) -->
|
||||
|
@ -27,8 +27,8 @@
|
|||
<source path='client' />
|
||||
<source path='shared' />
|
||||
|
||||
<set-property name="gwt.logging.logLevel" value="SEVERE"/>
|
||||
<set-property name="gwt.logging.logLevel" value="INFO"/>
|
||||
<set-property name="gwt.logging.enabled" value="TRUE"/>
|
||||
<!-- <set-property name="gwt.logging.logLevel" value="SEVERE"/> -->
|
||||
<!-- <set-property name="gwt.logging.logLevel" value="INFO"/> -->
|
||||
<!-- <set-property name="gwt.logging.enabled" value="TRUE"/> -->
|
||||
|
||||
</module>
|
||||
|
|
Loading…
Reference in New Issue