1452: Implement a GUI for StatMan Algorithms Importer

Task-Url: https://support.d4science.org/issues/1452

Added some log

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/statistical-algorithms-importer@124750 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2016-03-02 09:10:22 +00:00
parent ffe2c85472
commit 627c4df36e
2 changed files with 10 additions and 3 deletions

View File

@ -212,7 +212,7 @@ public class StatAlgoImporterServiceImpl extends RemoteServiceServlet implements
try { try {
HttpSession session = this.getThreadLocalRequest().getSession(); HttpSession session = this.getThreadLocalRequest().getSession();
ASLSession aslSession = SessionUtil.getAslSession(session); ASLSession aslSession = SessionUtil.getAslSession(session);
logger.debug("createProjectOnWorkspace()"); logger.debug("createProjectOnWorkspace(): "+newProjectFolder);
if (ProjectArchiver.existProjectInFolder(newProjectFolder, if (ProjectArchiver.existProjectInFolder(newProjectFolder,
aslSession)) { aslSession)) {
throw new StatAlgoImporterServiceException( throw new StatAlgoImporterServiceException(
@ -222,7 +222,9 @@ public class StatAlgoImporterServiceImpl extends RemoteServiceServlet implements
newProjectFolder); newProjectFolder);
Project projectSession = new Project(projectFolder); Project projectSession = new Project(projectFolder);
SessionUtil.setProjectSession(session, projectSession); SessionUtil.setProjectSession(session, projectSession);
logger.debug("Create Project: "+projectSession);
} }
return; return;
} catch (StatAlgoImporterServiceException e) { } catch (StatAlgoImporterServiceException e) {
e.printStackTrace(); e.printStackTrace();
@ -266,7 +268,7 @@ public class StatAlgoImporterServiceImpl extends RemoteServiceServlet implements
try { try {
HttpSession session = this.getThreadLocalRequest().getSession(); HttpSession session = this.getThreadLocalRequest().getSession();
ASLSession aslSession=SessionUtil.getAslSession(session); ASLSession aslSession=SessionUtil.getAslSession(session);
logger.debug("SetMainCode()"); logger.debug("SetMainCode(): "+itemDescription);
Project project = SessionUtil.getProjectSession(session); Project project = SessionUtil.getProjectSession(session);
if (project != null) { if (project != null) {
project.setMainCode(new MainCode(itemDescription)); project.setMainCode(new MainCode(itemDescription));
@ -275,6 +277,7 @@ public class StatAlgoImporterServiceImpl extends RemoteServiceServlet implements
WPS4RParser wps4Parser=new WPS4RParser(project, aslSession); WPS4RParser wps4Parser=new WPS4RParser(project, aslSession);
project=wps4Parser.parse(); project=wps4Parser.parse();
SessionUtil.setProjectSession(session, project); SessionUtil.setProjectSession(session, project);
logger.debug("Project: "+project);
} else { } else {
throw new StatAlgoImporterServiceException("No project open!"); throw new StatAlgoImporterServiceException("No project open!");
} }

View File

@ -474,12 +474,16 @@ public class AlgorithmGenerator {
} }
private String retrieveMainScriptRelativePath() { private String retrieveMainScriptRelativePath() {
logger.debug("ProjectInfo: "+project);
String projectPath = project.getProjectFolder().getFolder().getPath(); String projectPath = project.getProjectFolder().getFolder().getPath();
String mainCodePath = project.getMainCode().getItemDescription() String mainCodePath = project.getMainCode().getItemDescription()
.getPath(); .getPath();
logger.debug("ProjectPath: "+projectPath);
logger.debug("MainCodePath: "+mainCodePath);
String relativePath = project.getProjectFolder().getFolder().getName() String relativePath = project.getProjectFolder().getFolder().getName()
+ mainCodePath.substring(projectPath.length()); + mainCodePath.substring(projectPath.length());
logger.debug("RelativePath:"+relativePath);
return relativePath; return relativePath;
} }