Minor update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/statistical-algorithms-importer@178694 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2019-03-26 15:06:29 +00:00
parent 28e34e9b7d
commit c381ebac85
1 changed files with 6 additions and 110 deletions

View File

@ -103,58 +103,6 @@ public class AlgorithmGenerator {
code.add(" }");
code.add(" }");
/*
* code.add(" String[] "+ nameEnum + " = {"); String[]
* values = globalVariable.getDefaultValue().split( "\\|");
* if (values.length < 1) {
*
* } else { for (int i = 0; i < values.length; i++) { if (i
* == values.length - 1) { code.add(" \"" + values[i]
* + "\""); } else { code.add(" \"" + values[i] +
* "\","); } } } code.add(" };");
*/
/*
* code.add(" public static enum opGV" +
* globalVariable.getId() + " {"); String[] values =
* globalVariable.getDefaultValue().split( "\\|"); if
* (values.length < 1) {
*
* } else { for (int i = 0; i < values.length; i++) { String
* identifier = values[i].trim();
* identifier=identifier.replaceAll("\\s+","");
*
* if (i == values.length - 1) { code.add(" " +
* identifier + "(\"" + values[i] + "\");"); } else {
* code.add(" " + identifier + "(\"" + values[i] +
* "\"),"); } } }
*
* code.add(" ");
* code.add(" private final String id;");
* code.add(" "); code.add(" private opGV" +
* globalVariable.getId() + "(final String id) {");
* code.add(" this.id = id;"); code.add(" }");
* code.add(" "); code.add(" @Override");
* code.add(" public String toString() {");
* code.add(" return id;"); code.add(" }");
* code.add(" ");
* code.add(" public String getId() {");
* code.add(" return id;"); code.add(" }");
* code.add(" ");
*
* code.add(" public opIO" + globalVariable.getId() +
* " getIdentifier(String identifier){"); code.
* add(" if(identifier==null|| identifier.isEmpty()){"
* ); code.add(" return null;");
* code.add(" }"); code.add(" ");
* code.add(" for(opIO" + globalVariable.getId() +
* " value:opIO" + globalVariable.getId() + ".values()){");
* code.
* add(" if(value.id.compareTo(identifier)==0){"
* ); code.add(" return value;");
* code.add(" }"); code.add(" }");
* code.add(" return null;"); code.add(" }");
* code.add(" "); code.add(" }");
*/
}
}
@ -180,57 +128,6 @@ public class AlgorithmGenerator {
code.add(" }");
code.add(" }");
/*
* code.add(" String[] opIO" + inputOutputVariable.getId()
* + " = {"); String[] values =
* inputOutputVariable.getDefaultValue() .split("\\|"); if
* (values.length < 1) {
*
* } else { for (int i = 0; i < values.length; i++) { if (i
* == values.length - 1) { code.add(" \"" + values[i]
* + "\""); } else { code.add(" \"" + values[i] +
* "\","); } } } code.add(" };");
*/
/*
* code.add(" public static enum opIO"
*
* + inputOutputVariable.getId() + " {"); String[] values =
* inputOutputVariable.getDefaultValue() .split("\\|"); if
* (values.length < 1) {
*
* } else { for (int i = 0; i < values.length; i++) { String
* identifier = values[i].trim(); identifier =
* identifier.replaceAll("\\s+", ""); if (i == values.length
* - 1) { code.add(" " + identifier + "(\"" +
* values[i] + "\");"); } else { code.add(" " +
* identifier + "(\"" + values[i] + "\"),"); } } }
* code.add(" ");
* code.add(" private final String id;");
* code.add(" "); code.add(" private opIO" +
* inputOutputVariable.getId() + "(final String id) {");
* code.add(" this.id = id;"); code.add(" }");
* code.add(" "); code.add(" @Override");
* code.add(" public String toString() {");
* code.add(" return id;"); code.add(" }");
* code.add(" ");
* code.add(" public String getId() {");
* code.add(" return id;"); code.add(" }");
* code.add(" "); code.add(" public opIO" +
* inputOutputVariable.getId() +
* " getIdentifier(String identifier){"); code.
* add(" if(identifier==null|| identifier.isEmpty()){"
* ); code.add(" return null;");
* code.add(" }"); code.add(" ");
* code.add(" for(opIO" +
* inputOutputVariable.getId() + " value:opIO" +
* inputOutputVariable.getId() + ".values()){"); code.
* add(" if(value.id.compareTo(identifier)==0){"
* ); code.add(" return value;");
* code.add(" }"); code.add(" }");
* code.add(" return null;"); code.add(" }");
* code.add(" "); code.add(" }");
*/
}
}
@ -257,13 +154,13 @@ public class AlgorithmGenerator {
}
}
code.add("");
for (GlobalVariables globalVariable : project.getInputData().getListGlobalVariables()) {
code.add(" inputvariables.add(\"" + globalVariable.getName() + "\");");
}
for (InputOutputVariables selVariable : project.getInputData().getListInputOutputVariables()) {
if (selVariable != null && selVariable.getDataType() != null) {
switch (selVariable.getIoType()) {
@ -347,7 +244,7 @@ public class AlgorithmGenerator {
}
}
}
logger.debug("Algorithm Description: "+algorithmDescription);
logger.debug("Algorithm Description: " + algorithmDescription);
return algorithmDescription;
}
@ -494,14 +391,13 @@ public class AlgorithmGenerator {
}
}
//TODO
private String retrieveMainScriptRelativePath() {
logger.debug("ProjectInfo: " + project);
String projectPath = project.getProjectFolder().getFolder().getPath();
String mainCodePath = project.getMainCode().getItemDescription().getPath();
String projectFolderName=project.getProjectFolder().getFolder().getName();
String projectFolderName = project.getProjectFolder().getFolder().getName();
logger.debug("ProjectPath: " + projectPath);
logger.debug("Project Folder Name: "+projectFolderName);
logger.debug("Project Folder Name: " + projectFolderName);
logger.debug("MainCodePath: " + mainCodePath);
String relativePath = project.getProjectFolder().getFolder().getName()