Fixed R code add
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/statistical-algorithms-importer@160640 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
3b6ade4f1c
commit
170cf1eb2a
|
@ -56,13 +56,16 @@ public class StatAlgoImporterController {
|
|||
private StatAlgoImporterMonitor monitor;
|
||||
|
||||
private enum InputRequestType {
|
||||
Save, MainCodeSet, BinaryCodeSet, SoftwareCreate;
|
||||
Save, NewMainCodeSet, MainCodeSet, BinaryCodeSet, SoftwareCreate;
|
||||
}
|
||||
|
||||
private InputRequestType inputRequestType;
|
||||
private NewCodeEvent newCodeEvent;
|
||||
private ItemDescription mainCodeItemDescription;
|
||||
private ItemDescription binaryCodeItemDescription;
|
||||
|
||||
|
||||
|
||||
public StatAlgoImporterController() {
|
||||
eventBus = new SimpleEventBus();
|
||||
init();
|
||||
|
@ -332,6 +335,9 @@ public class StatAlgoImporterController {
|
|||
case SoftwareCreate:
|
||||
pm.softwareCreate(event.getInputData(), monitor);
|
||||
break;
|
||||
case NewMainCodeSet:
|
||||
pm.setNewCode(event.getInputData(),newCodeEvent, monitor);
|
||||
break;
|
||||
case MainCodeSet:
|
||||
pm.setMainCode(event.getInputData(), mainCodeItemDescription);
|
||||
break;
|
||||
|
@ -386,8 +392,6 @@ public class StatAlgoImporterController {
|
|||
mb.show();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void softwareRepackage() {
|
||||
pm.softwareRepackage();
|
||||
|
||||
|
@ -438,10 +442,16 @@ public class StatAlgoImporterController {
|
|||
|
||||
private void doSetNewMainCodeEvent(NewCodeEvent event) {
|
||||
monitor = new StatAlgoImporterMonitor();
|
||||
pm.setNewCode(event, monitor);
|
||||
newCodeEvent = event;
|
||||
inputRequestType = InputRequestType.NewMainCodeSet;
|
||||
InputRequestEvent inputRequestEvent = new InputRequestEvent();
|
||||
eventBus.fireEvent(inputRequestEvent);
|
||||
Log.debug("ProjectNewMainCodeSetRequest: " + inputRequestEvent);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void doDeleteItemCommand(DeleteItemEvent event) {
|
||||
ItemDescription itemDescription = event.getItemDescription();
|
||||
if (itemDescription != null && itemDescription.getId() != null) {
|
||||
|
|
|
@ -55,7 +55,7 @@ public class NewCodeEvent extends GwtEvent<NewCodeEvent.NewCodeEventHandler> {
|
|||
source.fireEvent(saveNewMainCodeEvent);
|
||||
}
|
||||
|
||||
public CodeContentType getCodeType() {
|
||||
public CodeContentType getCodeContentType() {
|
||||
return codeContentType;
|
||||
}
|
||||
|
||||
|
@ -72,6 +72,4 @@ public class NewCodeEvent extends GwtEvent<NewCodeEvent.NewCodeEventHandler> {
|
|||
return "NewCodeEvent [codeContentType=" + codeContentType + ", file=" + file + ", code=" + code + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -529,8 +529,8 @@ public class ProjectManager {
|
|||
|
||||
}
|
||||
|
||||
public void setNewCode(NewCodeEvent newCodeEvent, final StatAlgoImporterMonitor monitor) {
|
||||
StatAlgoImporterServiceAsync.INSTANCE.setNewCode(newCodeEvent.getFile(), newCodeEvent.getCode(),
|
||||
public void setNewCode(InputData inputData, NewCodeEvent newCodeEvent, final StatAlgoImporterMonitor monitor) {
|
||||
StatAlgoImporterServiceAsync.INSTANCE.setNewCode(inputData, newCodeEvent.getFile(), newCodeEvent.getCode(),
|
||||
new AsyncCallback<Project>() {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -36,7 +36,8 @@ public interface StatAlgoImporterService extends RemoteService {
|
|||
* Retrieve SAI descriptort
|
||||
*
|
||||
* @return SAI descriptort
|
||||
* @throws StatAlgoImporterServiceException Exception
|
||||
* @throws StatAlgoImporterServiceException
|
||||
* Exception
|
||||
*/
|
||||
public SAIDescriptor getSAIDescripor() throws StatAlgoImporterServiceException;
|
||||
|
||||
|
@ -53,7 +54,8 @@ public interface StatAlgoImporterService extends RemoteService {
|
|||
// Code
|
||||
public ArrayList<CodeData> getCode() throws StatAlgoImporterServiceException;
|
||||
|
||||
public Project createProjectOnWorkspace(ProjectCreateSession projectCreateSession) throws StatAlgoImporterServiceException;
|
||||
public Project createProjectOnWorkspace(ProjectCreateSession projectCreateSession)
|
||||
throws StatAlgoImporterServiceException;
|
||||
|
||||
//
|
||||
public Project setMainCode(ItemDescription itemDescription) throws StatAlgoImporterServiceException;
|
||||
|
@ -76,7 +78,8 @@ public interface StatAlgoImporterService extends RemoteService {
|
|||
|
||||
public Project restoreUISession(String value) throws StatAlgoImporterServiceException;
|
||||
|
||||
public Project setNewCode(ItemDescription itemDescription, String code) throws StatAlgoImporterServiceException;
|
||||
public Project setNewCode(InputData inputData, ItemDescription itemDescription, String code)
|
||||
throws StatAlgoImporterServiceException;
|
||||
|
||||
public String publishSoftware() throws StatAlgoImporterServiceException;
|
||||
|
||||
|
@ -86,5 +89,4 @@ public interface StatAlgoImporterService extends RemoteService {
|
|||
|
||||
public void repackageSoftware() throws StatAlgoImporterServiceException;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ public interface StatAlgoImporterServiceAsync {
|
|||
|
||||
void saveCode(String code, AsyncCallback<Void> asyncCallback);
|
||||
|
||||
void setNewCode(ItemDescription itemDescription, String code, AsyncCallback<Project> asyncCallback);
|
||||
void setNewCode(InputData inputData, ItemDescription itemDescription, String code, AsyncCallback<Project> asyncCallback);
|
||||
|
||||
void createSoftware(InputData inputData, AsyncCallback<Project> callback);
|
||||
|
||||
|
|
|
@ -593,11 +593,11 @@ public class StatAlgoImporterServiceImpl extends RemoteServiceServlet implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public Project setNewCode(ItemDescription fileDescription, String code) throws StatAlgoImporterServiceException {
|
||||
public Project setNewCode(InputData inputData,ItemDescription fileDescription, String code) throws StatAlgoImporterServiceException {
|
||||
try {
|
||||
HttpServletRequest httpRequest = this.getThreadLocalRequest();
|
||||
ServiceCredentials serviceCredentials = SessionUtil.getServiceCredentials(httpRequest);
|
||||
logger.debug("saveNewCode(): itemDescription" + fileDescription + ", code:" + code);
|
||||
logger.debug("setNewCode(): "+inputData+", " + fileDescription + ", " + code);
|
||||
Project project = SessionUtil.getProjectSession(httpRequest, serviceCredentials);
|
||||
if (project != null && project.getProjectFolder() != null
|
||||
&& project.getProjectFolder().getFolder() != null) {
|
||||
|
@ -609,9 +609,9 @@ public class StatAlgoImporterServiceImpl extends RemoteServiceServlet implements
|
|||
code, project.getProjectFolder().getFolder().getId());
|
||||
MainCode mainCode = new MainCode(mainCodeItemDescription);
|
||||
project.setMainCode(mainCode);
|
||||
InputData inputData=project.getInputData();
|
||||
if(inputData!=null){
|
||||
inputData.setListInputOutputVariables(null);
|
||||
project.setInputData(inputData);
|
||||
}
|
||||
project.setProjectTarget(null);
|
||||
WPS4RParser wps4Parser = new WPS4RParser(project, serviceCredentials);
|
||||
|
@ -625,6 +625,7 @@ public class StatAlgoImporterServiceImpl extends RemoteServiceServlet implements
|
|||
ItemDescription binaryCodeItemDescription = codeSave.saveNew(serviceCredentials,
|
||||
fileDescription, code, project.getProjectFolder().getFolder().getId());
|
||||
projectSupportBashEdit.setBinaryItem(binaryCodeItemDescription);
|
||||
project.setInputData(inputData);
|
||||
project.setProjectTarget(null);
|
||||
} else {
|
||||
throw new StatAlgoImporterServiceException("Error in project support!");
|
||||
|
|
Loading…
Reference in New Issue