1452: Implement a GUI for StatMan Algorithms Importer
Task-Url: https://support.d4science.org/issues/1452 Added DND to upload project files git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/statistical-algorithms-importer@121741 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
c77b18b404
commit
6c76f94416
18
pom.xml
18
pom.xml
|
@ -64,6 +64,12 @@
|
||||||
<profile>
|
<profile>
|
||||||
<id>localRun</id>
|
<id>localRun</id>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<!-- Xerces -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>xerces</groupId>
|
||||||
|
<artifactId>xercesImpl</artifactId>
|
||||||
|
<version>2.11.0</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
@ -233,7 +239,7 @@
|
||||||
|
|
||||||
<!-- AceGWT Widget -->
|
<!-- AceGWT Widget -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.portlets.widget</groupId>
|
<groupId>org.gcube.portlets.widgets</groupId>
|
||||||
<artifactId>acegwt-widget</artifactId>
|
<artifactId>acegwt-widget</artifactId>
|
||||||
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@ -245,6 +251,14 @@
|
||||||
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Workspace Uploader -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.portlets.widgets</groupId>
|
||||||
|
<artifactId>workspace-uploader</artifactId>
|
||||||
|
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Home Library -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.common</groupId>
|
<groupId>org.gcube.common</groupId>
|
||||||
<artifactId>home-library</artifactId>
|
<artifactId>home-library</artifactId>
|
||||||
|
@ -264,6 +278,8 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- LOGGING -->
|
<!-- LOGGING -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.allen-sauer.gwt.log</groupId>
|
<groupId>com.allen-sauer.gwt.log</groupId>
|
||||||
|
|
|
@ -2,19 +2,18 @@ package org.gcube.portlets.user.statisticalalgorithmsimporter.client;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.ImportCodeEvent;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.DeleteItemEvent;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.MainCodeSetEvent;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.MainCodeSetEvent;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.SessionExpiredEvent;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.SessionExpiredEvent;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.StatAlgoImporterRibbonEvent;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.StatAlgoImporterRibbonEvent;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.UIStateEvent;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.UIStateEvent;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.maindata.MainCodeDescription;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.maindata.ItemDescription;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.project.ProjectManager;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.project.ProjectManager;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.rpc.StatAlgoImporterServiceAsync;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.rpc.StatAlgoImporterServiceAsync;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.type.SessionExpiredType;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.type.SessionExpiredType;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.type.StatAlgoImporterRibbonType;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.type.StatAlgoImporterRibbonType;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.type.UIStateType;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.type.UIStateType;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.upload.CodeUploadDialog;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.upload.CodeUploadDialog;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.upload.ImportCodeDescription;
|
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.utils.UtilsGXT3;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.utils.UtilsGXT3;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.Constants;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.Constants;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.exception.StatAlgoImporterSessionExpiredException;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.exception.StatAlgoImporterSessionExpiredException;
|
||||||
|
@ -176,18 +175,6 @@ public class StatAlgoImporterController {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
eventBus.addHandler(ImportCodeEvent.TYPE,
|
|
||||||
new ImportCodeEvent.ImportCodeEventHandler() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onImportCode(ImportCodeEvent event) {
|
|
||||||
Log.debug("Catch ImportCodeEvent");
|
|
||||||
doImportCodeCommand(event);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
eventBus.addHandler(MainCodeSetEvent.TYPE,
|
eventBus.addHandler(MainCodeSetEvent.TYPE,
|
||||||
new MainCodeSetEvent.MainCodeSetEventHandler() {
|
new MainCodeSetEvent.MainCodeSetEventHandler() {
|
||||||
|
|
||||||
|
@ -196,13 +183,21 @@ public class StatAlgoImporterController {
|
||||||
Log.debug("Catch MainCodeSetEvent");
|
Log.debug("Catch MainCodeSetEvent");
|
||||||
doMainCodeSetCommand(event);
|
doMainCodeSetCommand(event);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
eventBus.addHandler(DeleteItemEvent.TYPE,
|
||||||
|
new DeleteItemEvent.DeleteItemEventHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDelete(DeleteItemEvent event) {
|
||||||
|
Log.debug("Catch DeleteItemEvent");
|
||||||
|
doDeleteItemCommand(event);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
eventBus.fireEvent(new UIStateEvent(UIStateType.START));
|
eventBus.fireEvent(new UIStateEvent(UIStateType.START));
|
||||||
|
|
||||||
|
@ -239,22 +234,18 @@ public class StatAlgoImporterController {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void doMainCodeSetCommand(MainCodeSetEvent event) {
|
private void doMainCodeSetCommand(MainCodeSetEvent event) {
|
||||||
MainCodeDescription mainCodeDescription = event.getMainCodeDescription();
|
ItemDescription itemDescription = event.getItemDescription();
|
||||||
if (mainCodeDescription != null
|
if (itemDescription != null && itemDescription.getId() != null) {
|
||||||
&& mainCodeDescription.getId() != null) {
|
pm.setMainCode(itemDescription);
|
||||||
pm.setMainCode(mainCodeDescription);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doImportCodeCommand(ImportCodeEvent event) {
|
private void doDeleteItemCommand(DeleteItemEvent event) {
|
||||||
ImportCodeDescription importCodeDesc = event.getImportCodeDescription();
|
ItemDescription itemDescription = event.getItemDescription();
|
||||||
if (importCodeDesc != null
|
if (itemDescription != null && itemDescription.getId() != null) {
|
||||||
&& importCodeDesc.getImportCodeType() != null) {
|
pm.deleteItem(itemDescription);
|
||||||
pm.importCode(importCodeDesc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,67 @@
|
||||||
|
package org.gcube.portlets.user.statisticalalgorithmsimporter.client.event;
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.maindata.ItemDescription;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.EventHandler;
|
||||||
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
import com.google.gwt.event.shared.HandlerRegistration;
|
||||||
|
import com.google.gwt.event.shared.HasHandlers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main Code Set Event
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author "Giancarlo Panichi" <a
|
||||||
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class DeleteItemEvent extends
|
||||||
|
GwtEvent<DeleteItemEvent.DeleteItemEventHandler> {
|
||||||
|
|
||||||
|
public static Type<DeleteItemEventHandler> TYPE = new Type<DeleteItemEventHandler>();
|
||||||
|
private ItemDescription itemDescription;
|
||||||
|
|
||||||
|
public interface DeleteItemEventHandler extends EventHandler {
|
||||||
|
void onDelete(DeleteItemEvent event);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface HasDeleteItemEventHandler extends HasHandlers {
|
||||||
|
public HandlerRegistration addDeleteItemEventHandler(
|
||||||
|
DeleteItemEventHandler handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DeleteItemEvent(ItemDescription itemDescription) {
|
||||||
|
this.itemDescription = itemDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void dispatch(DeleteItemEventHandler handler) {
|
||||||
|
handler.onDelete(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Type<DeleteItemEventHandler> getAssociatedType() {
|
||||||
|
return TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Type<DeleteItemEventHandler> getType() {
|
||||||
|
return TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void fire(HasHandlers source, DeleteItemEvent deleteItemEvent) {
|
||||||
|
source.fireEvent(deleteItemEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemDescription getItemDescription() {
|
||||||
|
return itemDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "DeleteItemEvent [itemDescription=" + itemDescription + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
package org.gcube.portlets.user.statisticalalgorithmsimporter.client.event;
|
package org.gcube.portlets.user.statisticalalgorithmsimporter.client.event;
|
||||||
|
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.maindata.MainCodeDescription;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.maindata.ItemDescription;
|
||||||
|
|
||||||
import com.google.gwt.event.shared.EventHandler;
|
import com.google.gwt.event.shared.EventHandler;
|
||||||
import com.google.gwt.event.shared.GwtEvent;
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
@ -19,7 +19,7 @@ public class MainCodeSetEvent extends
|
||||||
GwtEvent<MainCodeSetEvent.MainCodeSetEventHandler> {
|
GwtEvent<MainCodeSetEvent.MainCodeSetEventHandler> {
|
||||||
|
|
||||||
public static Type<MainCodeSetEventHandler> TYPE = new Type<MainCodeSetEventHandler>();
|
public static Type<MainCodeSetEventHandler> TYPE = new Type<MainCodeSetEventHandler>();
|
||||||
private MainCodeDescription mainCodeDescription;
|
private ItemDescription itemDescription;
|
||||||
|
|
||||||
public interface MainCodeSetEventHandler extends EventHandler {
|
public interface MainCodeSetEventHandler extends EventHandler {
|
||||||
void onMainCodeSet(MainCodeSetEvent event);
|
void onMainCodeSet(MainCodeSetEvent event);
|
||||||
|
@ -30,8 +30,8 @@ public class MainCodeSetEvent extends
|
||||||
MainCodeSetEventHandler handler);
|
MainCodeSetEventHandler handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MainCodeSetEvent(MainCodeDescription mainCodeDescription) {
|
public MainCodeSetEvent(ItemDescription itemDescription) {
|
||||||
this.mainCodeDescription = mainCodeDescription;
|
this.itemDescription = itemDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -48,24 +48,17 @@ public class MainCodeSetEvent extends
|
||||||
return TYPE;
|
return TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void fire(HasHandlers source,
|
public static void fire(HasHandlers source, MainCodeSetEvent importCodeEvent) {
|
||||||
MainCodeSetEvent importCodeEvent) {
|
|
||||||
source.fireEvent(importCodeEvent);
|
source.fireEvent(importCodeEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MainCodeDescription getMainCodeDescription() {
|
public ItemDescription getItemDescription() {
|
||||||
return mainCodeDescription;
|
return itemDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "MainCodeSetEvent [mainCodeDescription=" + mainCodeDescription
|
return "MainCodeSetEvent [itemDescription=" + itemDescription + "]";
|
||||||
+ "]";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ import java.io.Serializable;
|
||||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class MainCodeDescription implements Serializable {
|
public class ItemDescription implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -6624452446980057923L;
|
private static final long serialVersionUID = -6624452446980057923L;
|
||||||
|
|
||||||
|
@ -17,7 +17,11 @@ public class MainCodeDescription implements Serializable {
|
||||||
private String owner;
|
private String owner;
|
||||||
private String path;
|
private String path;
|
||||||
|
|
||||||
public MainCodeDescription(String id, String name, String owner, String path) {
|
public ItemDescription(){
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemDescription(String id, String name, String owner, String path) {
|
||||||
super();
|
super();
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
@ -59,8 +63,9 @@ public class MainCodeDescription implements Serializable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "MainCodeDescription [id=" + id + ", name=" + name + ", owner="
|
return "ItemDescription [id=" + id + ", name=" + name + ", owner="
|
||||||
+ owner + ", path=" + path + "]";
|
+ owner + ", path=" + path + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,10 +1,13 @@
|
||||||
package org.gcube.portlets.user.statisticalalgorithmsimporter.client.project;
|
package org.gcube.portlets.user.statisticalalgorithmsimporter.client.project;
|
||||||
|
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.ProjectStatusEvent;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.ProjectStatusEvent;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.maindata.MainCodeDescription;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.SessionExpiredEvent;
|
||||||
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.maindata.ItemDescription;
|
||||||
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.rpc.StatAlgoImporterServiceAsync;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.type.ProjectStatusEventType;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.type.ProjectStatusEventType;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.upload.ImportCodeDescription;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.type.SessionExpiredType;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.utils.UtilsGXT3;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.utils.UtilsGXT3;
|
||||||
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.exception.StatAlgoImporterSessionExpiredException;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
|
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.client.select.WorkspaceExplorerSelectDialog;
|
import org.gcube.portlets.widgets.wsexplorer.client.select.WorkspaceExplorerSelectDialog;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
|
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
|
||||||
|
@ -12,42 +15,27 @@ import org.gcube.portlets.widgets.wsexplorer.shared.ItemType;
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
import com.google.gwt.event.shared.EventBus;
|
import com.google.gwt.event.shared.EventBus;
|
||||||
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
import com.sencha.gxt.core.client.dom.XDOM;
|
import com.sencha.gxt.core.client.dom.XDOM;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author giancarlo
|
* @author Giancarlo Panichi email: <a
|
||||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ProjectManager {
|
public class ProjectManager {
|
||||||
private EventBus eventBus;
|
private EventBus eventBus;
|
||||||
private String projectFolderId;
|
private String projectFolderId;
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
private ItemDescription mainCodeDescription;
|
||||||
|
|
||||||
public ProjectManager(EventBus eventBus) {
|
public ProjectManager(EventBus eventBus) {
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createProject() {
|
public void createProject() {
|
||||||
/*
|
|
||||||
List<ItemType> selectableTypes = new ArrayList<ItemType>();
|
|
||||||
selectableTypes.add(ItemType.FOLDER);
|
|
||||||
List<ItemType> showableTypes = new ArrayList<ItemType>();
|
|
||||||
showableTypes.addAll(Arrays.asList(ItemType.FOLDER));
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
List<String> allowedMimeTypes = Arrays.asList("text/csv",
|
|
||||||
"application/zip", "application/x-zip",
|
|
||||||
"application/x-zip-compressed", "application/octet-stream",
|
|
||||||
"application/x-compress", "application/x-compressed",
|
|
||||||
"multipart/x-zip");
|
|
||||||
List<String> allowedFileExtensions = Arrays.asList("csv", "zip");
|
|
||||||
|
|
||||||
FilterCriteria filterCriteria = new FilterCriteria(allowedMimeTypes,
|
|
||||||
allowedFileExtensions, new HashMap<String, String>());
|
|
||||||
*/
|
|
||||||
WorkspaceExplorerSelectDialog wselectDialog = new WorkspaceExplorerSelectDialog(
|
WorkspaceExplorerSelectDialog wselectDialog = new WorkspaceExplorerSelectDialog(
|
||||||
"Select Project Folder", true);
|
"Select Project Folder", true);
|
||||||
|
|
||||||
|
@ -57,10 +45,11 @@ public class ProjectManager {
|
||||||
public void onSelectedItem(Item item) {
|
public void onSelectedItem(Item item) {
|
||||||
|
|
||||||
if (item.getType() == ItemType.FOLDER) {
|
if (item.getType() == ItemType.FOLDER) {
|
||||||
createProjectOnWorkspace(item);
|
createProjectOnServer(item);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
UtilsGXT3.info("Attention", "Select a valid project folder!");
|
UtilsGXT3.info("Attention",
|
||||||
|
"Select a valid project folder!");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -86,29 +75,73 @@ public class ProjectManager {
|
||||||
wselectDialog.show();
|
wselectDialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void createProjectOnWorkspace(Item item){
|
protected void createProjectOnServer(Item item) {
|
||||||
Log.debug("Item selected: " + item);
|
Log.debug("Item selected: " + item);
|
||||||
projectFolderId = item.getId();
|
projectFolderId = item.getId();
|
||||||
ProjectStatusEvent projectStatusEvent= new ProjectStatusEvent(ProjectStatusEventType.OPEN, projectFolderId);
|
StatAlgoImporterServiceAsync.INSTANCE.createProjectOnWorkspace(
|
||||||
|
item.getId(), new AsyncCallback<Void>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Void result) {
|
||||||
|
fireProjectStatusOpenEvent();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable caught) {
|
||||||
|
Log.debug(caught.getLocalizedMessage());
|
||||||
|
caught.printStackTrace();
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMainCode(ItemDescription mainCodeDescription) {
|
||||||
|
this.mainCodeDescription = mainCodeDescription;
|
||||||
|
Log.debug("Main: " + mainCodeDescription);
|
||||||
|
StatAlgoImporterServiceAsync.INSTANCE.setMainCode(
|
||||||
|
mainCodeDescription.getId(), new AsyncCallback<Void>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable caught) {
|
||||||
|
if (caught instanceof StatAlgoImporterSessionExpiredException) {
|
||||||
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
|
} else {
|
||||||
|
Log.error("Error setting main code: "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error",
|
||||||
|
caught.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
caught.printStackTrace();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Void result) {
|
||||||
|
fireProjectStatusEventUpdate();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteItem(ItemDescription itemDescription) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void fireProjectStatusOpenEvent() {
|
||||||
|
ProjectStatusEvent projectStatusEvent = new ProjectStatusEvent(
|
||||||
|
ProjectStatusEventType.OPEN, projectFolderId);
|
||||||
eventBus.fireEvent(projectStatusEvent);
|
eventBus.fireEvent(projectStatusEvent);
|
||||||
Log.debug("ProjectStatusEvent fired");
|
Log.debug("ProjectStatusEvent fired");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void importCode(ImportCodeDescription importCodeDesc) {
|
protected void fireProjectStatusEventUpdate() {
|
||||||
ProjectStatusEvent projectStatusEvent= new ProjectStatusEvent(ProjectStatusEventType.UPDATE, projectFolderId);
|
ProjectStatusEvent projectStatusEvent = new ProjectStatusEvent(
|
||||||
|
ProjectStatusEventType.UPDATE, projectFolderId);
|
||||||
eventBus.fireEvent(projectStatusEvent);
|
eventBus.fireEvent(projectStatusEvent);
|
||||||
Log.debug("ProjectStatusEvent fired");
|
Log.debug("ProjectStatusEvent fired");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMainCode(MainCodeDescription mainCodeDescription) {
|
|
||||||
ProjectStatusEvent projectStatusEvent= new ProjectStatusEvent(ProjectStatusEventType.UPDATE, projectFolderId);
|
|
||||||
eventBus.fireEvent(projectStatusEvent);
|
|
||||||
Log.debug("ProjectStatusEvent fired");
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@ import java.util.ArrayList;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.code.CodeData;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.code.CodeData;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.exception.StatAlgoImporterServiceException;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.exception.StatAlgoImporterServiceException;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.file.FileUploadMonitor;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.file.FileUploadMonitor;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.ProjectOnWorkspaceStatus;
|
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.session.UserInfo;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.session.UserInfo;
|
||||||
|
|
||||||
import com.google.gwt.user.client.rpc.RemoteService;
|
import com.google.gwt.user.client.rpc.RemoteService;
|
||||||
|
@ -41,7 +40,7 @@ public interface StatAlgoImporterService extends RemoteService {
|
||||||
public ArrayList<CodeData> getCode()
|
public ArrayList<CodeData> getCode()
|
||||||
throws StatAlgoImporterServiceException;
|
throws StatAlgoImporterServiceException;
|
||||||
|
|
||||||
public ProjectOnWorkspaceStatus createProjectOnWorkspace(String itemId)
|
public void createProjectOnWorkspace(String itemId)
|
||||||
throws StatAlgoImporterServiceException;
|
throws StatAlgoImporterServiceException;
|
||||||
//
|
//
|
||||||
public void setMainCode(String itemId)
|
public void setMainCode(String itemId)
|
||||||
|
|
|
@ -7,7 +7,6 @@ import java.util.ArrayList;
|
||||||
|
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.code.CodeData;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.code.CodeData;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.file.FileUploadMonitor;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.file.FileUploadMonitor;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.ProjectOnWorkspaceStatus;
|
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.session.UserInfo;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.session.UserInfo;
|
||||||
|
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
|
@ -35,7 +34,7 @@ public interface StatAlgoImporterServiceAsync {
|
||||||
void getCode(AsyncCallback<ArrayList<CodeData>> callback);
|
void getCode(AsyncCallback<ArrayList<CodeData>> callback);
|
||||||
|
|
||||||
void createProjectOnWorkspace(String itemId,
|
void createProjectOnWorkspace(String itemId,
|
||||||
AsyncCallback<ProjectOnWorkspaceStatus> callback);
|
AsyncCallback<Void> callback);
|
||||||
|
|
||||||
void setMainCode(String itemId, AsyncCallback<Void> callback);
|
void setMainCode(String itemId, AsyncCallback<Void> callback);
|
||||||
|
|
||||||
|
|
|
@ -1,27 +1,22 @@
|
||||||
package org.gcube.portlets.user.statisticalalgorithmsimporter.client.tools.explorer;
|
package org.gcube.portlets.user.statisticalalgorithmsimporter.client.tools.explorer;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.DeleteItemEvent;
|
||||||
|
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.MainCodeSetEvent;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.MainCodeSetEvent;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.ProjectStatusEvent;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.ProjectStatusEvent;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.SessionExpiredEvent;
|
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.UIStateEvent;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.UIStateEvent;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.maindata.MainCodeDescription;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.maindata.ItemDescription;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.resource.StatAlgoImporterResources;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.resource.StatAlgoImporterResources;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.rpc.StatAlgoImporterServiceAsync;
|
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.type.SessionExpiredType;
|
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.utils.UtilsGXT3;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.utils.UtilsGXT3;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.code.CodeData;
|
import org.gcube.portlets.widgets.workspaceuploader.client.WorkspaceUploadNotification.WorskpaceUploadNotificationListener;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.exception.StatAlgoImporterSessionExpiredException;
|
import org.gcube.portlets.widgets.workspaceuploader.client.uploader.DialogUpload.UPLOAD_TYPE;
|
||||||
|
import org.gcube.portlets.widgets.workspaceuploader.client.uploader.dragdrop.MultipleDNDUpload;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.client.explore.WorkspaceResourcesExplorerPanel;
|
import org.gcube.portlets.widgets.wsexplorer.client.explore.WorkspaceResourcesExplorerPanel;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
|
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
|
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.shared.ItemType;
|
import org.gcube.portlets.widgets.wsexplorer.shared.ItemType;
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
import com.google.gwt.core.client.GWT;
|
|
||||||
import com.google.gwt.event.shared.EventBus;
|
import com.google.gwt.event.shared.EventBus;
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
|
||||||
import com.sencha.gxt.cell.core.client.ButtonCell.ButtonScale;
|
import com.sencha.gxt.cell.core.client.ButtonCell.ButtonScale;
|
||||||
import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign;
|
import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign;
|
||||||
import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode;
|
import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode;
|
||||||
|
@ -48,6 +43,9 @@ public class ExplorerProjectPanel extends ContentPanel {
|
||||||
private EventBus eventBus;
|
private EventBus eventBus;
|
||||||
private Item selectedItem;
|
private Item selectedItem;
|
||||||
private TextButton btnSetMain;
|
private TextButton btnSetMain;
|
||||||
|
private MultipleDNDUpload dnd;
|
||||||
|
private WorkspaceResourcesExplorerPanel wsResourcesExplorerPanel;
|
||||||
|
private TextButton btnDelete;
|
||||||
|
|
||||||
public ExplorerProjectPanel(EventBus eventBus) {
|
public ExplorerProjectPanel(EventBus eventBus) {
|
||||||
super();
|
super();
|
||||||
|
@ -138,10 +136,10 @@ public class ExplorerProjectPanel extends ContentPanel {
|
||||||
private void create(ProjectStatusEvent event) {
|
private void create(ProjectStatusEvent event) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
WorkspaceResourcesExplorerPanel wsResourcesExplorerPanel = new WorkspaceResourcesExplorerPanel(
|
wsResourcesExplorerPanel = new WorkspaceResourcesExplorerPanel(
|
||||||
event.getProjectFolderId(), false);
|
event.getProjectFolderId(), false);
|
||||||
|
|
||||||
WorskpaceExplorerSelectNotificationListener listener = new WorskpaceExplorerSelectNotificationListener() {
|
WorskpaceExplorerSelectNotificationListener wsResourceExplorerListener = new WorskpaceExplorerSelectNotificationListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onSelectedItem(Item item) {
|
public void onSelectedItem(Item item) {
|
||||||
Log.debug("Listener Selected Item " + item);
|
Log.debug("Listener Selected Item " + item);
|
||||||
|
@ -167,8 +165,56 @@ public class ExplorerProjectPanel extends ContentPanel {
|
||||||
};
|
};
|
||||||
|
|
||||||
wsResourcesExplorerPanel
|
wsResourcesExplorerPanel
|
||||||
.addWorkspaceExplorerSelectNotificationListener(listener);
|
.addWorkspaceExplorerSelectNotificationListener(wsResourceExplorerListener);
|
||||||
|
wsResourcesExplorerPanel.ensureDebugId("wsResourceExplorerPanel");
|
||||||
|
|
||||||
|
VerticalLayoutContainer vResourcesExplorerContainer = new VerticalLayoutContainer();
|
||||||
|
vResourcesExplorerContainer.setScrollMode(ScrollMode.AUTO);
|
||||||
|
vResourcesExplorerContainer.add(wsResourcesExplorerPanel,
|
||||||
|
new VerticalLayoutData(1, -1, new Margins(0)));
|
||||||
|
|
||||||
|
// DND
|
||||||
|
|
||||||
|
dnd = new MultipleDNDUpload();
|
||||||
|
dnd.setParameters(event.getProjectFolderId(), UPLOAD_TYPE.File);
|
||||||
|
dnd.addUniqueContainer(vResourcesExplorerContainer);
|
||||||
|
WorskpaceUploadNotificationListener workspaceUploaderListener = new WorskpaceUploadNotificationListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUploadCompleted(String parentId, String itemId) {
|
||||||
|
Log.debug("Upload completed: [parentID: " + parentId
|
||||||
|
+ ", itemId: " + itemId + "]");
|
||||||
|
wsResourcesExplorerPanel.refreshRootFolderView();
|
||||||
|
forceLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUploadAborted(String parentId, String itemId) {
|
||||||
|
Log.debug("Upload Aborted: [parentID: " + parentId
|
||||||
|
+ ", itemId: " + itemId + "]");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(String parentId, String itemId,
|
||||||
|
Throwable throwable) {
|
||||||
|
Log.debug("Upload Error: [parentID: " + parentId
|
||||||
|
+ ", itemId: " + itemId + "]");
|
||||||
|
throwable.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onOverwriteCompleted(String parentId, String itemId) {
|
||||||
|
Log.debug("Upload Override Completed: [parentID: "
|
||||||
|
+ parentId + ", itemId: " + itemId + "]");
|
||||||
|
wsResourcesExplorerPanel.refreshRootFolderView();
|
||||||
|
forceLayout();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
dnd.addWorkspaceUploadNotificationListener(workspaceUploaderListener);
|
||||||
|
|
||||||
|
// ToolBar
|
||||||
btnSetMain = new TextButton("Set Main");
|
btnSetMain = new TextButton("Set Main");
|
||||||
btnSetMain.setIcon(StatAlgoImporterResources.INSTANCE.add16());
|
btnSetMain.setIcon(StatAlgoImporterResources.INSTANCE.add16());
|
||||||
btnSetMain.setScale(ButtonScale.SMALL);
|
btnSetMain.setScale(ButtonScale.SMALL);
|
||||||
|
@ -183,16 +229,32 @@ public class ExplorerProjectPanel extends ContentPanel {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
btnDelete = new TextButton("Delete");
|
||||||
|
btnDelete.setIcon(StatAlgoImporterResources.INSTANCE.add16());
|
||||||
|
btnDelete.setScale(ButtonScale.SMALL);
|
||||||
|
btnDelete.setIconAlign(IconAlign.LEFT);
|
||||||
|
btnDelete.setToolTip("Delete");
|
||||||
|
btnDelete.addSelectHandler(new SelectHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSelect(SelectEvent event) {
|
||||||
|
deleteItem(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ToolBar toolBar = new ToolBar();
|
ToolBar toolBar = new ToolBar();
|
||||||
toolBar.add(btnSetMain, new BoxLayoutData(new Margins(0)));
|
toolBar.add(btnSetMain, new BoxLayoutData(new Margins(0)));
|
||||||
|
|
||||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||||
|
|
||||||
v.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0)));
|
v.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||||
v.add(wsResourcesExplorerPanel, new VerticalLayoutData(1, 1,
|
v.add(dnd, new VerticalLayoutData(1, 1, new Margins(0)));
|
||||||
new Margins(0)));
|
|
||||||
add(v, new MarginData(new Margins(0)));
|
add(v, new MarginData(new Margins(0)));
|
||||||
wsResourcesExplorerPanel.ensureDebugId("wsResourceExplorerPanel");
|
|
||||||
forceLayout();
|
forceLayout();
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -203,46 +265,36 @@ public class ExplorerProjectPanel extends ContentPanel {
|
||||||
|
|
||||||
private void setMainCode(SelectEvent event) {
|
private void setMainCode(SelectEvent event) {
|
||||||
Log.debug("Set Main Code");
|
Log.debug("Set Main Code");
|
||||||
if (selectedItem != null&& selectedItem.getType().compareTo(ItemType.EXTERNAL_FILE)==0) {
|
if (selectedItem != null
|
||||||
|
&& selectedItem.getType().compareTo(ItemType.EXTERNAL_FILE) == 0) {
|
||||||
loadData();
|
loadData();
|
||||||
} else {
|
} else {
|
||||||
UtilsGXT3.info("Attention", "Select a valid file to be used as main!");
|
UtilsGXT3.info("Attention",
|
||||||
|
"Select a valid file to be used as main!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void deleteItem(SelectEvent event) {
|
||||||
|
ItemDescription itemDescription = new ItemDescription(
|
||||||
|
selectedItem.getId(), selectedItem.getName(),
|
||||||
|
selectedItem.getOwner(), selectedItem.getPath());
|
||||||
|
DeleteItemEvent deleteItemEvent = new DeleteItemEvent(
|
||||||
|
itemDescription);
|
||||||
|
eventBus.fireEvent(deleteItemEvent);
|
||||||
|
Log.debug("Fired: " + deleteItemEvent);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void loadData() {
|
private void loadData() {
|
||||||
StatAlgoImporterServiceAsync.INSTANCE.setMainCode(selectedItem.getId(), new AsyncCallback<Void>(){
|
ItemDescription itemDescription = new ItemDescription(
|
||||||
|
selectedItem.getId(), selectedItem.getName(),
|
||||||
@Override
|
selectedItem.getOwner(), selectedItem.getPath());
|
||||||
public void onFailure(Throwable caught) {
|
MainCodeSetEvent mainCodeSetEvent = new MainCodeSetEvent(
|
||||||
if (caught instanceof StatAlgoImporterSessionExpiredException) {
|
itemDescription);
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(
|
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
|
||||||
} else {
|
|
||||||
Log.error("Error setting main code: "
|
|
||||||
+ caught.getLocalizedMessage());
|
|
||||||
UtilsGXT3.alert("Error",
|
|
||||||
caught.getLocalizedMessage());
|
|
||||||
}
|
|
||||||
caught.printStackTrace();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(Void result) {
|
|
||||||
MainCodeDescription mainCodeDescription=new MainCodeDescription(selectedItem.getId(), selectedItem.getName(), selectedItem.getOwner(), selectedItem.getPath());
|
|
||||||
MainCodeSetEvent mainCodeSetEvent=new MainCodeSetEvent(mainCodeDescription);
|
|
||||||
eventBus.fireEvent(mainCodeSetEvent);
|
eventBus.fireEvent(mainCodeSetEvent);
|
||||||
Log.debug("Fired: " + mainCodeSetEvent);
|
Log.debug("Fired: " + mainCodeSetEvent);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
package org.gcube.portlets.user.statisticalalgorithmsimporter.client.upload;
|
package org.gcube.portlets.user.statisticalalgorithmsimporter.client.upload;
|
||||||
|
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.event.ImportCodeEvent;
|
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.resource.StatAlgoImporterResources;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.resource.StatAlgoImporterResources;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.type.ImportCodeType;
|
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.upload.progress.FileUploadProgressBarUpdater;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.upload.progress.FileUploadProgressBarUpdater;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.upload.progress.FileUploadProgressListener;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.upload.progress.FileUploadProgressListener;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.upload.progress.FileUploadProgressUpdater;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.upload.progress.FileUploadProgressUpdater;
|
||||||
|
@ -41,7 +39,7 @@ public class CodeUploadPanel extends FormPanel {
|
||||||
|
|
||||||
private static final int STATUS_POLLING_DELAY = 1000;
|
private static final int STATUS_POLLING_DELAY = 1000;
|
||||||
|
|
||||||
private EventBus eventBus;
|
//private EventBus eventBus;
|
||||||
private CodeUploadDialog parent;
|
private CodeUploadDialog parent;
|
||||||
private FileUploadField fileUploadField;
|
private FileUploadField fileUploadField;
|
||||||
|
|
||||||
|
@ -51,14 +49,14 @@ public class CodeUploadPanel extends FormPanel {
|
||||||
//private FileUploadProgressUpdater progressUpdater;
|
//private FileUploadProgressUpdater progressUpdater;
|
||||||
|
|
||||||
private ProgressBar uploadProgressBar;
|
private ProgressBar uploadProgressBar;
|
||||||
private String fileName;
|
//private String fileName;
|
||||||
|
|
||||||
private FileUploadProgressUpdater progressUpdater;
|
private FileUploadProgressUpdater progressUpdater;
|
||||||
|
|
||||||
public CodeUploadPanel(CodeUploadDialog parent, EventBus eventBus) {
|
public CodeUploadPanel(CodeUploadDialog parent, EventBus eventBus) {
|
||||||
super();
|
super();
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
this.eventBus = eventBus;
|
//this.eventBus = eventBus;
|
||||||
init();
|
init();
|
||||||
create();
|
create();
|
||||||
|
|
||||||
|
@ -136,7 +134,8 @@ public class CodeUploadPanel extends FormPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
fileName = fname;
|
@SuppressWarnings("unused")
|
||||||
|
String fileName = fname;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
fileUploadField.setAllowBlank(false);
|
fileUploadField.setAllowBlank(false);
|
||||||
|
@ -169,9 +168,12 @@ public class CodeUploadPanel extends FormPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void operationComplete() {
|
public void operationComplete() {
|
||||||
|
//TODO now import is only on by workspace widget
|
||||||
|
/*
|
||||||
ImportCodeDescription desc=new ImportCodeDescription(ImportCodeType.FILE, fileName);
|
ImportCodeDescription desc=new ImportCodeDescription(ImportCodeType.FILE, fileName);
|
||||||
ImportCodeEvent importEvent=new ImportCodeEvent(desc);
|
ImportCodeEvent importEvent=new ImportCodeEvent(desc);
|
||||||
eventBus.fireEvent(importEvent);
|
eventBus.fireEvent(importEvent);
|
||||||
|
*/
|
||||||
parent.close();
|
parent.close();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -13,7 +13,7 @@ import org.gcube.portlets.user.statisticalalgorithmsimporter.server.file.CodeFil
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.Constants;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.Constants;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.exception.StatAlgoImporterSessionExpiredException;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.exception.StatAlgoImporterSessionExpiredException;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.file.FileUploadMonitor;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.file.FileUploadMonitor;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.session.ProjectSession;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.Project;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.session.SessionConstants;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.session.SessionConstants;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -113,27 +113,26 @@ public class SessionUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
public static void setProject(HttpSession httpSession,
|
public static void setProjectSession(HttpSession httpSession,
|
||||||
ProjectSession p) throws StatAlgoImporterSessionExpiredException {
|
Project project) throws StatAlgoImporterSessionExpiredException {
|
||||||
|
Project p = (Project) httpSession
|
||||||
ProjectSession projectSession = (ProjectSession) httpSession
|
.getAttribute(SessionConstants.PROJECT);
|
||||||
.getAttribute(SessionConstants.PROJECT_SESSION);
|
if (p != null)
|
||||||
if (projectSession != null)
|
|
||||||
httpSession
|
httpSession
|
||||||
.removeAttribute(SessionConstants.PROJECT_SESSION);
|
.removeAttribute(SessionConstants.PROJECT);
|
||||||
httpSession.setAttribute(
|
httpSession.setAttribute(
|
||||||
SessionConstants.PROJECT_SESSION, p);
|
SessionConstants.PROJECT, project);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ProjectSession getProjectSession(
|
public static Project getProjectSession(
|
||||||
HttpSession httpSession) {
|
HttpSession httpSession) {
|
||||||
ProjectSession projectSession = (ProjectSession) httpSession
|
Project project = (Project) httpSession
|
||||||
.getAttribute(SessionConstants.PROJECT_SESSION);
|
.getAttribute(SessionConstants.PROJECT);
|
||||||
if (projectSession == null) {
|
if (project == null) {
|
||||||
logger.error("ProjectSession was not acquired");
|
logger.error("Project was not acquired");
|
||||||
}
|
}
|
||||||
return projectSession;
|
return project;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,12 +8,12 @@ import javax.servlet.http.HttpSession;
|
||||||
import org.gcube.application.framework.core.session.ASLSession;
|
import org.gcube.application.framework.core.session.ASLSession;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.rpc.StatAlgoImporterService;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.client.rpc.StatAlgoImporterService;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.server.file.CodeReader;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.server.file.CodeReader;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.server.file.CodeFileUploadSession;
|
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.code.CodeData;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.code.CodeData;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.exception.StatAlgoImporterServiceException;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.exception.StatAlgoImporterServiceException;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.file.FileUploadMonitor;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.file.FileUploadMonitor;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.ProjectOnWorkspaceStatus;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.MainCode;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.session.ProjectSession;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.Project;
|
||||||
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.ProjectFolder;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.session.UserInfo;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.session.UserInfo;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -112,11 +112,11 @@ public class StatAlgoImporterServiceImpl extends RemoteServiceServlet implements
|
||||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||||
ASLSession aslSession=SessionUtil.getAslSession(session);
|
ASLSession aslSession=SessionUtil.getAslSession(session);
|
||||||
logger.debug("getCode()");
|
logger.debug("getCode()");
|
||||||
ProjectSession projectSession = SessionUtil
|
Project projectSession = SessionUtil
|
||||||
.getProjectSession(session);
|
.getProjectSession(session);
|
||||||
if (projectSession != null) {
|
if (projectSession != null) {
|
||||||
CodeReader codeFileReader = new CodeReader(
|
CodeReader codeFileReader = new CodeReader(
|
||||||
projectSession, aslSession.getUsername());
|
projectSession, aslSession);
|
||||||
ArrayList<CodeData> codeList = codeFileReader.getCodeList();
|
ArrayList<CodeData> codeList = codeFileReader.getCodeList();
|
||||||
for (CodeData codeData : codeList) {
|
for (CodeData codeData : codeList) {
|
||||||
logger.debug("" + codeData.getId() + " "
|
logger.debug("" + codeData.getId() + " "
|
||||||
|
@ -143,14 +143,18 @@ public class StatAlgoImporterServiceImpl extends RemoteServiceServlet implements
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ProjectOnWorkspaceStatus createProjectOnWorkspace(String itemId)
|
public void createProjectOnWorkspace(String itemId)
|
||||||
throws StatAlgoImporterServiceException {
|
throws StatAlgoImporterServiceException {
|
||||||
try {
|
try {
|
||||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||||
SessionUtil.getAslSession(session);
|
SessionUtil.getAslSession(session);
|
||||||
logger.debug("createProjectOnWorkspace()");
|
logger.debug("createProjectOnWorkspace()");
|
||||||
|
ProjectFolder projectFolder=new ProjectFolder(itemId);
|
||||||
|
Project projectSession = new Project(projectFolder);
|
||||||
|
SessionUtil.setProjectSession(session, projectSession);
|
||||||
|
|
||||||
return new ProjectOnWorkspaceStatus();
|
|
||||||
|
return;
|
||||||
} catch (StatAlgoImporterServiceException e) {
|
} catch (StatAlgoImporterServiceException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw e;
|
throw e;
|
||||||
|
@ -169,8 +173,14 @@ public class StatAlgoImporterServiceImpl extends RemoteServiceServlet implements
|
||||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||||
SessionUtil.getAslSession(session);
|
SessionUtil.getAslSession(session);
|
||||||
logger.debug("SetMainCode()");
|
logger.debug("SetMainCode()");
|
||||||
|
Project project = SessionUtil
|
||||||
|
.getProjectSession(session);
|
||||||
|
if (project != null) {
|
||||||
|
project.setMainCode(new MainCode(itemId));
|
||||||
|
SessionUtil.setProjectSession(session, project);
|
||||||
|
} else {
|
||||||
|
throw new StatAlgoImporterServiceException("No project open!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1,23 +1,22 @@
|
||||||
package org.gcube.portlets.user.statisticalalgorithmsimporter.server.file;
|
package org.gcube.portlets.user.statisticalalgorithmsimporter.server.file;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import org.gcube.application.framework.core.session.ASLSession;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.server.storage.FilesStorage;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.server.storage.FilesStorage;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.code.CodeData;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.code.CodeData;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.exception.StatAlgoImporterServiceException;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.exception.StatAlgoImporterServiceException;
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.session.ProjectSession;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.Project;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CodeFileReader
|
* CodeReader
|
||||||
*
|
*
|
||||||
* Read code and convert it in ArrayList
|
* Read code and convert it in ArrayList
|
||||||
*
|
*
|
||||||
|
@ -29,63 +28,22 @@ public class CodeReader {
|
||||||
private Logger logger = LoggerFactory.getLogger(CodeReader.class);
|
private Logger logger = LoggerFactory.getLogger(CodeReader.class);
|
||||||
private ArrayList<CodeData> code;
|
private ArrayList<CodeData> code;
|
||||||
|
|
||||||
public CodeReader(CodeFileUploadSession codeFileUploadSession)
|
public CodeReader(Project projectSession, ASLSession aslSession)
|
||||||
throws StatAlgoImporterServiceException {
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (codeFileUploadSession == null
|
|
||||||
|| codeFileUploadSession.getCodeFile() == null) {
|
|
||||||
throw new StatAlgoImporterServiceException(
|
|
||||||
"CodeFileUploadSession is invalid");
|
|
||||||
}
|
|
||||||
|
|
||||||
code = new ArrayList<CodeData>();
|
|
||||||
FileInputStream fio = new FileInputStream(
|
|
||||||
codeFileUploadSession.getCodeFile());
|
|
||||||
|
|
||||||
InputStreamReader isr = new InputStreamReader(fio);
|
|
||||||
|
|
||||||
BufferedReader br = new BufferedReader((Reader) isr);
|
|
||||||
|
|
||||||
String s;
|
|
||||||
int i = 1;
|
|
||||||
while ((s = br.readLine()) != null) {
|
|
||||||
CodeData codeData = new CodeData(i, s);
|
|
||||||
code.add(codeData);
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
fio.close();
|
|
||||||
logger.trace("CodeList size: " + code.size());
|
|
||||||
|
|
||||||
} catch (FileNotFoundException e) {
|
|
||||||
logger.error("File Not Found: " + e.getLocalizedMessage());
|
|
||||||
e.printStackTrace();
|
|
||||||
throw new StatAlgoImporterServiceException(e.getLocalizedMessage());
|
|
||||||
|
|
||||||
} catch (IOException e) {
|
|
||||||
logger.error("IOException: " + e.getLocalizedMessage());
|
|
||||||
e.printStackTrace();
|
|
||||||
throw new StatAlgoImporterServiceException(e.getLocalizedMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public CodeReader(ProjectSession projectSession, String user)
|
|
||||||
throws StatAlgoImporterServiceException {
|
throws StatAlgoImporterServiceException {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if (projectSession == null || projectSession.getMainCode() == null
|
if (projectSession == null || projectSession.getMainCode() == null
|
||||||
|| projectSession.getMainCode().getItemId() == null) {
|
|| projectSession.getMainCode().getItemId() == null) {
|
||||||
throw new StatAlgoImporterServiceException(
|
throw new StatAlgoImporterServiceException(
|
||||||
"MainCodeSession is invalid");
|
"Project hasn't a valid main set!");
|
||||||
}
|
}
|
||||||
|
|
||||||
String itemId = projectSession.getMainCode().getItemId();
|
String itemId = projectSession.getMainCode().getItemId();
|
||||||
|
|
||||||
code = new ArrayList<CodeData>();
|
code = new ArrayList<CodeData>();
|
||||||
FilesStorage filesStorage = new FilesStorage();
|
FilesStorage filesStorage = new FilesStorage();
|
||||||
InputStream is = filesStorage.retrieveItemOnWorkspace(user, itemId);
|
InputStream is = filesStorage.retrieveItemOnWorkspace(
|
||||||
|
aslSession.getUsername(), itemId);
|
||||||
|
|
||||||
InputStreamReader isr = new InputStreamReader(is);
|
InputStreamReader isr = new InputStreamReader(is);
|
||||||
|
|
||||||
|
|
|
@ -1,28 +1,16 @@
|
||||||
package org.gcube.portlets.user.statisticalalgorithmsimporter.server.storage;
|
package org.gcube.portlets.user.statisticalalgorithmsimporter.server.storage;
|
||||||
|
|
||||||
import java.io.BufferedInputStream;
|
|
||||||
import java.io.BufferedOutputStream;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.net.URL;
|
|
||||||
import java.net.URLConnection;
|
import java.net.URLConnection;
|
||||||
|
|
||||||
import org.gcube.common.homelibrary.home.HomeLibrary;
|
import org.gcube.common.homelibrary.home.HomeLibrary;
|
||||||
import org.gcube.common.homelibrary.home.exceptions.HomeNotFoundException;
|
import org.gcube.common.homelibrary.home.exceptions.HomeNotFoundException;
|
||||||
import org.gcube.common.homelibrary.home.exceptions.InternalErrorException;
|
import org.gcube.common.homelibrary.home.exceptions.InternalErrorException;
|
||||||
import org.gcube.common.homelibrary.home.workspace.Workspace;
|
import org.gcube.common.homelibrary.home.workspace.Workspace;
|
||||||
import org.gcube.common.homelibrary.home.workspace.WorkspaceFolder;
|
|
||||||
import org.gcube.common.homelibrary.home.workspace.WorkspaceItem;
|
import org.gcube.common.homelibrary.home.workspace.WorkspaceItem;
|
||||||
import org.gcube.common.homelibrary.home.workspace.exceptions.ItemNotFoundException;
|
import org.gcube.common.homelibrary.home.workspace.exceptions.ItemNotFoundException;
|
||||||
import org.gcube.common.homelibrary.home.workspace.exceptions.WorkspaceFolderNotFoundException;
|
import org.gcube.common.homelibrary.home.workspace.exceptions.WorkspaceFolderNotFoundException;
|
||||||
import org.gcube.common.homelibrary.util.WorkspaceUtil;
|
|
||||||
import org.gcube.contentmanagement.blobstorage.service.IClient;
|
|
||||||
import org.gcube.contentmanager.storageclient.model.protocol.smp.SMPUrl;
|
import org.gcube.contentmanager.storageclient.model.protocol.smp.SMPUrl;
|
||||||
import org.gcube.contentmanager.storageclient.wrapper.AccessType;
|
|
||||||
import org.gcube.contentmanager.storageclient.wrapper.MemoryType;
|
|
||||||
import org.gcube.contentmanager.storageclient.wrapper.StorageClient;
|
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.exception.StatAlgoImporterServiceException;
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.exception.StatAlgoImporterServiceException;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -39,135 +27,6 @@ public class FilesStorage {
|
||||||
public static final Logger logger = LoggerFactory
|
public static final Logger logger = LoggerFactory
|
||||||
.getLogger(FilesStorage.class);
|
.getLogger(FilesStorage.class);
|
||||||
|
|
||||||
public String storageCSVTempFile(String user, File file) {
|
|
||||||
try {
|
|
||||||
IClient client = new StorageClient(user, AccessType.PUBLIC,
|
|
||||||
MemoryType.VOLATILE).getClient();
|
|
||||||
String remotePath = "/CSVimport/" + file.getName();
|
|
||||||
logger.debug("remotePath: " + remotePath);
|
|
||||||
String id = client.put(true).LFile(file.getAbsolutePath())
|
|
||||||
.RFile(remotePath);
|
|
||||||
// url = client.getUrl().RFile(remotePath);
|
|
||||||
return id;
|
|
||||||
|
|
||||||
} catch (Throwable e) {
|
|
||||||
logger.error("Error no csv file loaded on storage"
|
|
||||||
+ e.getLocalizedMessage());
|
|
||||||
e.printStackTrace();
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public String storageCodelistMappingTempFile(String user, File file) {
|
|
||||||
try {
|
|
||||||
// String url = null;
|
|
||||||
IClient client = new StorageClient(user, AccessType.PUBLIC,
|
|
||||||
MemoryType.VOLATILE).getClient();
|
|
||||||
String remotePath = "/CodelistMappingImport/" + file.getName();
|
|
||||||
logger.debug("remotePath: " + remotePath);
|
|
||||||
String id = client.put(true).LFile(file.getAbsolutePath())
|
|
||||||
.RFile(remotePath);
|
|
||||||
// url = client.getUrl().RFile(remotePath);
|
|
||||||
return id;
|
|
||||||
} catch (Throwable e) {
|
|
||||||
logger.error("Error no codelist mapping file loaded on storage"
|
|
||||||
+ e.getLocalizedMessage());
|
|
||||||
e.printStackTrace();
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public String storageCodelistMappingTempFile(String user, String url)
|
|
||||||
throws StatAlgoImporterServiceException {
|
|
||||||
InputStream is = null;
|
|
||||||
try {
|
|
||||||
URL address = new URL(url);
|
|
||||||
is = address.openStream();
|
|
||||||
|
|
||||||
IClient client = new StorageClient(user, AccessType.PUBLIC,
|
|
||||||
MemoryType.VOLATILE).getClient();
|
|
||||||
String remotePath = "/CodelistMappingImport/" + address.getFile();
|
|
||||||
logger.debug("remotePath: " + remotePath);
|
|
||||||
String id = client.put(true).LFile(is).RFile(remotePath);
|
|
||||||
is.close();
|
|
||||||
|
|
||||||
return id;
|
|
||||||
} catch (IOException e) {
|
|
||||||
logger.error("Error no codelist mapping file loaded on storage"
|
|
||||||
+ e.getLocalizedMessage());
|
|
||||||
e.printStackTrace();
|
|
||||||
throw new StatAlgoImporterServiceException(
|
|
||||||
"Error no codelist mapping file loaded on storage"
|
|
||||||
+ e.getLocalizedMessage());
|
|
||||||
} catch (Throwable e) {
|
|
||||||
logger.error("Error no codelist mapping file loaded on storage"
|
|
||||||
+ e.getLocalizedMessage());
|
|
||||||
e.printStackTrace();
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* user
|
|
||||||
*
|
|
||||||
* @param user
|
|
||||||
* User
|
|
||||||
* @param remotePath
|
|
||||||
* File path on storage
|
|
||||||
* @param file
|
|
||||||
* Destination file
|
|
||||||
* @throws StatAlgoImporterServiceException
|
|
||||||
*/
|
|
||||||
public void retriveFile(String user, WorkspaceItem wi, File file)
|
|
||||||
throws StatAlgoImporterServiceException {
|
|
||||||
InputStream is = null;
|
|
||||||
try {
|
|
||||||
|
|
||||||
org.gcube.common.homelibrary.home.workspace.folder.items.File gcubeItem = ((org.gcube.common.homelibrary.home.workspace.folder.items.File) wi);
|
|
||||||
SMPUrl smsHome = new SMPUrl(gcubeItem.getPublicLink());
|
|
||||||
/*
|
|
||||||
* Handler.activateProtocol(); URL smsHome = null; smsHome = new
|
|
||||||
* URL(gcubeItem.getPublicLink());
|
|
||||||
*/
|
|
||||||
logger.debug("smsHome: [host:" + smsHome.getHost() + " path:"
|
|
||||||
+ smsHome.getPath() + " ref:" + smsHome.getRef()
|
|
||||||
+ " userinfo:" + smsHome.getUserInfo() + " ]");
|
|
||||||
URLConnection uc = null;
|
|
||||||
uc = (URLConnection) smsHome.openConnection();
|
|
||||||
is = uc.getInputStream();
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error retrieving file from storage", e);
|
|
||||||
e.printStackTrace();
|
|
||||||
throw new StatAlgoImporterServiceException(
|
|
||||||
"Error retrieving file from storage: "
|
|
||||||
+ e.getLocalizedMessage(), e);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
BufferedInputStream bis = new BufferedInputStream(is);
|
|
||||||
FileOutputStream os = new FileOutputStream(file);
|
|
||||||
BufferedOutputStream bos = new BufferedOutputStream(os);
|
|
||||||
byte[] buffer = new byte[1024];
|
|
||||||
int readCount;
|
|
||||||
while ((readCount = bis.read(buffer)) > 0) {
|
|
||||||
bos.write(buffer, 0, readCount);
|
|
||||||
}
|
|
||||||
bos.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
logger.error(
|
|
||||||
"Error trasferring file from storage: "
|
|
||||||
+ e.getLocalizedMessage(), e);
|
|
||||||
e.printStackTrace();
|
|
||||||
throw new StatAlgoImporterServiceException(
|
|
||||||
"Error trasferring file from storage: "
|
|
||||||
+ e.getLocalizedMessage(), e);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -209,15 +68,6 @@ public class FilesStorage {
|
||||||
org.gcube.common.homelibrary.home.workspace.folder.items.File gcubeItem = ((org.gcube.common.homelibrary.home.workspace.folder.items.File) wi);
|
org.gcube.common.homelibrary.home.workspace.folder.items.File gcubeItem = ((org.gcube.common.homelibrary.home.workspace.folder.items.File) wi);
|
||||||
SMPUrl smsHome = new SMPUrl(gcubeItem.getPublicLink());
|
SMPUrl smsHome = new SMPUrl(gcubeItem.getPublicLink());
|
||||||
|
|
||||||
/*
|
|
||||||
* Handler.activateProtocol(); URL smsHome = null; smsHome = new
|
|
||||||
* URL(null, gcubeItem.getPublicLink(), new URLStreamHandler() {
|
|
||||||
*
|
|
||||||
* @Override protected URLConnection openConnection(URL u) throws
|
|
||||||
* IOException { return new SMPURLConnection(u); }
|
|
||||||
*
|
|
||||||
* });
|
|
||||||
*/
|
|
||||||
logger.debug("smsHome: [host:" + smsHome.getHost() + " path:"
|
logger.debug("smsHome: [host:" + smsHome.getHost() + " path:"
|
||||||
+ smsHome.getPath() + " ref:" + smsHome.getRef()
|
+ smsHome.getPath() + " ref:" + smsHome.getRef()
|
||||||
+ " userinfo:" + smsHome.getUserInfo() + " ]");
|
+ " userinfo:" + smsHome.getUserInfo() + " ]");
|
||||||
|
@ -237,145 +87,6 @@ public class FilesStorage {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param user
|
|
||||||
* User
|
|
||||||
* @param remotePath
|
|
||||||
* File path on storage
|
|
||||||
* @return InputStream back to read the file
|
|
||||||
* @throws StatAlgoImporterServiceException
|
|
||||||
*/
|
|
||||||
public InputStream retrieveImputStream(String uri)
|
|
||||||
throws StatAlgoImporterServiceException {
|
|
||||||
InputStream is = null;
|
|
||||||
try {
|
|
||||||
|
|
||||||
SMPUrl smsHome = new SMPUrl(uri);
|
|
||||||
/*
|
|
||||||
* Handler.activateProtocol(); URL smsHome = null; smsHome = new
|
|
||||||
* URL(null, uri, new URLStreamHandler() {
|
|
||||||
*
|
|
||||||
* @Override protected URLConnection openConnection(URL u) throws
|
|
||||||
* IOException { return new SMPURLConnection(u); }
|
|
||||||
*
|
|
||||||
* });
|
|
||||||
*/
|
|
||||||
|
|
||||||
logger.debug("smsHome: [host:" + smsHome.getHost() + " path:"
|
|
||||||
+ smsHome.getPath() + " ref:" + smsHome.getRef()
|
|
||||||
+ " userinfo:" + smsHome.getUserInfo() + " ]");
|
|
||||||
URLConnection uc = null;
|
|
||||||
uc = (URLConnection) smsHome.openConnection();
|
|
||||||
is = uc.getInputStream();
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error retrieving file from storage", e);
|
|
||||||
e.printStackTrace();
|
|
||||||
throw new StatAlgoImporterServiceException(
|
|
||||||
"Error retrieving file from storage: "
|
|
||||||
+ e.getLocalizedMessage(), e);
|
|
||||||
}
|
|
||||||
|
|
||||||
return is;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param user
|
|
||||||
* User
|
|
||||||
* @param remotePath
|
|
||||||
* File path on storage
|
|
||||||
* @return InputStream back to read the file
|
|
||||||
* @throws StatAlgoImporterServiceException
|
|
||||||
*/
|
|
||||||
public void createItemOnWorkspace(String uri, String user,
|
|
||||||
String item_name, String item_description, String item_mimetype,
|
|
||||||
String item_folder) throws StatAlgoImporterServiceException {
|
|
||||||
InputStream is = null;
|
|
||||||
try {
|
|
||||||
|
|
||||||
SMPUrl smsHome = new SMPUrl(uri);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* URL smsHome = new SMPUrl(); smsHome = new URL(null, uri, new
|
|
||||||
* URLStreamHandler() {
|
|
||||||
*
|
|
||||||
* @Override protected URLConnection openConnection(URL u) throws
|
|
||||||
* IOException { return new SMPURLConnection(u); }
|
|
||||||
*
|
|
||||||
* });
|
|
||||||
*/
|
|
||||||
|
|
||||||
logger.debug("smsHome: [host:" + smsHome.getHost() + " path:"
|
|
||||||
+ smsHome.getPath() + " ref:" + smsHome.getRef()
|
|
||||||
+ " userinfo:" + smsHome.getUserInfo() + " ]");
|
|
||||||
|
|
||||||
URLConnection uc = null;
|
|
||||||
uc = (URLConnection) smsHome.openConnection();
|
|
||||||
is = uc.getInputStream();
|
|
||||||
|
|
||||||
Workspace ws = HomeLibrary.getUserWorkspace(user);
|
|
||||||
|
|
||||||
WorkspaceFolder folder = (WorkspaceFolder) ws.getItem(item_folder);
|
|
||||||
String uniqueName = WorkspaceUtil.getUniqueName(item_name, folder);
|
|
||||||
|
|
||||||
logger.debug("ws.createExternalFile [folder: " + folder
|
|
||||||
+ ", uniqueName: " + uniqueName + ", description: "
|
|
||||||
+ item_description + ", mimetype: " + item_mimetype
|
|
||||||
+ ", InputStream: " + is + "]");
|
|
||||||
WorkspaceUtil.createExternalFile(folder, uniqueName,
|
|
||||||
item_description, item_mimetype, is);
|
|
||||||
|
|
||||||
is.close();
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error creating item on workspace", e);
|
|
||||||
e.printStackTrace();
|
|
||||||
throw new StatAlgoImporterServiceException(
|
|
||||||
"Error creating item on workspace: "
|
|
||||||
+ e.getLocalizedMessage(), e);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param storageId
|
|
||||||
* @param user
|
|
||||||
* @param item_name
|
|
||||||
* @param item_description
|
|
||||||
* @param item_mimetype
|
|
||||||
* @param item_folder
|
|
||||||
* @throws StatAlgoImporterServiceException
|
|
||||||
*/
|
|
||||||
public void createItemOnWorkspaceByStorageId(String storageId, String user,
|
|
||||||
String item_name, String item_description, String item_mimetype,
|
|
||||||
String item_folder) throws StatAlgoImporterServiceException {
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
Workspace ws = HomeLibrary.getUserWorkspace(user);
|
|
||||||
|
|
||||||
WorkspaceFolder folder = (WorkspaceFolder) ws.getItem(item_folder);
|
|
||||||
String uniqueName = WorkspaceUtil.getUniqueName(item_name, folder);
|
|
||||||
|
|
||||||
logger.debug("ws.createExternalFile [folder: " + folder
|
|
||||||
+ ", uniqueName: " + uniqueName + ", description: "
|
|
||||||
+ item_description + ", mimetype: " + item_mimetype
|
|
||||||
+ ", StorageId: " + storageId + "]");
|
|
||||||
WorkspaceUtil.createExternalFile(folder, uniqueName,
|
|
||||||
item_description, item_mimetype, storageId);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Error creating item on workspace", e);
|
|
||||||
e.printStackTrace();
|
|
||||||
throw new StatAlgoImporterServiceException(
|
|
||||||
"Error creating item on workspace: "
|
|
||||||
+ e.getLocalizedMessage(), e);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
package org.gcube.portlets.user.statisticalalgorithmsimporter.server.storage;
|
||||||
|
|
||||||
|
import java.beans.XMLEncoder;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.Project;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Giancarlo Panichi email: <a
|
||||||
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class ProjectArchiver {
|
||||||
|
|
||||||
|
public static final Logger logger = LoggerFactory
|
||||||
|
.getLogger(ProjectArchiver.class);
|
||||||
|
|
||||||
|
|
||||||
|
public static void archive(Project project) {
|
||||||
|
|
||||||
|
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||||
|
XMLEncoder xmlEncoder = new XMLEncoder(byteArrayOutputStream);
|
||||||
|
xmlEncoder.writeObject(project);
|
||||||
|
xmlEncoder.close();
|
||||||
|
logger.debug("Archived:" + byteArrayOutputStream);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -12,7 +12,7 @@ public class Constants {
|
||||||
public static final String STATRUNNER_ID = "StatRunnerId";
|
public static final String STATRUNNER_ID = "StatRunnerId";
|
||||||
public static final String STATRUNNER_LANG_COOKIE = "StatRunnerLangCookie";
|
public static final String STATRUNNER_LANG_COOKIE = "StatRunnerLangCookie";
|
||||||
public static final String STATRUNNER_LANG = "StatRunnerLang";
|
public static final String STATRUNNER_LANG = "StatRunnerLang";
|
||||||
public final static String DEFAULT_USER = "test.user";
|
public final static String DEFAULT_USER = "giancarlo.panichi";
|
||||||
//public final static String DEFAULT_SCOPE = "/gcube/devNext";
|
//public final static String DEFAULT_SCOPE = "/gcube/devNext";
|
||||||
public final static String DEFAULT_SCOPE = "/gcube/devsec/devVRE";
|
public final static String DEFAULT_SCOPE = "/gcube/devsec/devVRE";
|
||||||
|
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
package org.gcube.portlets.user.statisticalalgorithmsimporter.shared.session;
|
package org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project.MainCode;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author "Giancarlo Panichi" <a
|
* @author "Giancarlo Panichi" <a
|
||||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ProjectSession implements Serializable {
|
public class Project implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -7906477664944910362L;
|
private static final long serialVersionUID = -7906477664944910362L;
|
||||||
|
|
||||||
|
private ProjectFolder projectFolder;
|
||||||
private MainCode mainCode;
|
private MainCode mainCode;
|
||||||
|
|
||||||
public ProjectSession() {
|
public Project(ProjectFolder projectFolder) {
|
||||||
super();
|
super();
|
||||||
|
this.projectFolder=projectFolder;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,9 +29,20 @@ public class ProjectSession implements Serializable {
|
||||||
this.mainCode = mainCode;
|
this.mainCode = mainCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public ProjectFolder getProjectFolder() {
|
||||||
public String toString() {
|
return projectFolder;
|
||||||
return "ProjectSession [mainCode=" + mainCode + "]";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setProjectFolder(ProjectFolder projectFolder) {
|
||||||
|
this.projectFolder = projectFolder;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Project [projectFolder=" + projectFolder + ", mainCode="
|
||||||
|
+ mainCode + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
package org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Giancarlo Panichi email: <a
|
||||||
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class ProjectFolder implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 3698120963507381801L;
|
||||||
|
private String itemId;
|
||||||
|
|
||||||
|
public ProjectFolder(String itemId) {
|
||||||
|
super();
|
||||||
|
this.itemId = itemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getItemId() {
|
||||||
|
return itemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setItemId(String itemId) {
|
||||||
|
this.itemId = itemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ProjectFolder [itemId=" + itemId + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,26 +0,0 @@
|
||||||
package org.gcube.portlets.user.statisticalalgorithmsimporter.shared.project;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author giancarlo
|
|
||||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class ProjectOnWorkspaceStatus implements Serializable {
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = -6324401286337995414L;
|
|
||||||
|
|
||||||
public ProjectOnWorkspaceStatus(){
|
|
||||||
super();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -10,7 +10,7 @@ public class SessionConstants {
|
||||||
|
|
||||||
public static final String FILE_UPLOAD_MONITOR="FILE_UPLOAD_MONITOR";
|
public static final String FILE_UPLOAD_MONITOR="FILE_UPLOAD_MONITOR";
|
||||||
public static final String IMPORT_CODE_FILE_UPLOAD_SESSION = "IMPORT_CODE_FILE_UPLOAD_SESSION";
|
public static final String IMPORT_CODE_FILE_UPLOAD_SESSION = "IMPORT_CODE_FILE_UPLOAD_SESSION";
|
||||||
public static final String PROJECT_SESSION = "PROJECT_SESSION";
|
public static final String PROJECT = "PROJECT";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,9 @@
|
||||||
<!-- inherits Workspace Explorer widget -->
|
<!-- inherits Workspace Explorer widget -->
|
||||||
<inherits name='org.gcube.portlets.widgets.wsexplorer.WorkspaceExplorer' />
|
<inherits name='org.gcube.portlets.widgets.wsexplorer.WorkspaceExplorer' />
|
||||||
|
|
||||||
|
<!-- inherits Wokspace Uploader widget -->
|
||||||
|
<inherits name="org.gcube.portlets.widgets.workspaceuploader.WorkspaceUploader"></inherits>
|
||||||
|
|
||||||
<!-- Specify the app entry point class. -->
|
<!-- Specify the app entry point class. -->
|
||||||
<!-- <entry-point
|
<!-- <entry-point
|
||||||
class='org.gcube.portlets.user.statisticalalgorithmsimporter.client.StatAlgoImporter' /> -->
|
class='org.gcube.portlets.user.statisticalalgorithmsimporter.client.StatAlgoImporter' /> -->
|
||||||
|
|
|
@ -32,6 +32,10 @@
|
||||||
<!-- inherits WorkspaceExplorer widget -->
|
<!-- inherits WorkspaceExplorer widget -->
|
||||||
<inherits name='org.gcube.portlets.widgets.wsexplorer.WorkspaceExplorer' />
|
<inherits name='org.gcube.portlets.widgets.wsexplorer.WorkspaceExplorer' />
|
||||||
|
|
||||||
|
<!-- inherits Wokspace Uploader widget -->
|
||||||
|
<inherits
|
||||||
|
name="org.gcube.portlets.widgets.workspaceuploader.WorkspaceUploader" />
|
||||||
|
|
||||||
<!-- Specify the app entry point class. -->
|
<!-- Specify the app entry point class. -->
|
||||||
<entry-point
|
<entry-point
|
||||||
class='org.gcube.portlets.user.statisticalalgorithmsimporter.client.StatAlgoImporter' />
|
class='org.gcube.portlets.user.statisticalalgorithmsimporter.client.StatAlgoImporter' />
|
||||||
|
@ -47,7 +51,6 @@
|
||||||
name="locale" values="es" /> <set-property name="locale" value="en, it, es"
|
name="locale" values="es" /> <set-property name="locale" value="en, it, es"
|
||||||
/> <set-property-fallback name="locale" value="en" /> -->
|
/> <set-property-fallback name="locale" value="en" /> -->
|
||||||
|
|
||||||
|
|
||||||
<set-property name="log_ConsoleLogger" value="ENABLED" />
|
<set-property name="log_ConsoleLogger" value="ENABLED" />
|
||||||
<set-property name="log_DivLogger" value="ENABLED" />
|
<set-property name="log_DivLogger" value="ENABLED" />
|
||||||
<set-property name="log_GWTLogger" value="ENABLED" />
|
<set-property name="log_GWTLogger" value="ENABLED" />
|
||||||
|
|
|
@ -37,6 +37,16 @@
|
||||||
<servlet-class>org.gcube.portlets.widgets.wsexplorer.server.WorkspaceExplorerServiceImpl</servlet-class>
|
<servlet-class>org.gcube.portlets.widgets.wsexplorer.server.WorkspaceExplorerServiceImpl</servlet-class>
|
||||||
</servlet>
|
</servlet>
|
||||||
|
|
||||||
|
<!-- Workspace Uploader -->
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>workspaceUploaderService</servlet-name>
|
||||||
|
<servlet-class>org.gcube.portlets.widgets.workspaceuploader.server.WorkspaceUploaderServiceImpl</servlet-class>
|
||||||
|
</servlet>
|
||||||
|
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>workspaceUploadServletStream</servlet-name>
|
||||||
|
<servlet-class>org.gcube.portlets.widgets.workspaceuploader.server.WorkspaceUploadServletStream</servlet-class>
|
||||||
|
</servlet>
|
||||||
|
|
||||||
|
|
||||||
<!-- Servlets Mapping -->
|
<!-- Servlets Mapping -->
|
||||||
|
@ -71,6 +81,17 @@
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Workpsace Uploader -->
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>workspaceUploaderService</servlet-name>
|
||||||
|
<url-pattern>/statalgoimporter/workspaceUploaderService</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>workspaceUploadServletStream</servlet-name>
|
||||||
|
<url-pattern>/statalgoimporter/workspaceUploadServletStream</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
|
||||||
|
|
||||||
<!-- Default page to serve -->
|
<!-- Default page to serve -->
|
||||||
<welcome-file-list>
|
<welcome-file-list>
|
||||||
|
|
Loading…
Reference in New Issue