merged with private version at 181499
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@181671 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
9466f4407b
commit
f8eb5deebe
|
@ -1,11 +1,14 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||||
<wb-module deploy-name="workspace-6.22.0-SNAPSHOT">
|
<wb-module deploy-name="workspace-6.23.0-SNAPSHOT">
|
||||||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||||
<dependent-module archiveName="workspace-tree-widget-6.25.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/WorkspaceTree-TRUNK/WorkspaceTree-TRUNK">
|
<dependent-module archiveName="workspace-tree-widget-6.27.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/WorkspaceTree-TRUNK/WorkspaceTree-TRUNK">
|
||||||
|
<dependency-type>uses</dependency-type>
|
||||||
|
</dependent-module>
|
||||||
|
<dependent-module archiveName="ws-task-executor-widget-0.2.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/ws-task-executor-widget-TRUNK/ws-task-executor-widget-TRUNK">
|
||||||
<dependency-type>uses</dependency-type>
|
<dependency-type>uses</dependency-type>
|
||||||
</dependent-module>
|
</dependent-module>
|
||||||
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
|
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
<ReleaseNotes>
|
<ReleaseNotes>
|
||||||
|
<Changeset
|
||||||
|
component="org.gcube.portlets-user.workspace-portlet.6-23-0"
|
||||||
|
date="${buildDate}">
|
||||||
|
<Change>[Task #17226] Removing HL </Change>
|
||||||
|
</Changeset>
|
||||||
<Changeset
|
<Changeset
|
||||||
component="org.gcube.portlets-user.workspace-portlet.6-22-0"
|
component="org.gcube.portlets-user.workspace-portlet.6-22-0"
|
||||||
date="${buildDate}">
|
date="${buildDate}">
|
||||||
|
|
69
pom.xml
69
pom.xml
|
@ -12,7 +12,7 @@
|
||||||
<groupId>org.gcube.portlets.user</groupId>
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
<artifactId>workspace</artifactId>
|
<artifactId>workspace</artifactId>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
<version>6.22.0-SNAPSHOT</version>
|
<version>6.23.0-SNAPSHOT</version>
|
||||||
<name>gCube Workspace Portlet</name>
|
<name>gCube Workspace Portlet</name>
|
||||||
<description>
|
<description>
|
||||||
gCube Workspace Portlet is a web-gui to manage the gCube workspace a collaborative area where users can exchange and organize information objects (workspace items) according to their specific needs.
|
gCube Workspace Portlet is a web-gui to manage the gCube workspace a collaborative area where users can exchange and organize information objects (workspace items) according to their specific needs.
|
||||||
|
@ -99,7 +99,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.common.portal</groupId>
|
<groupId>org.gcube.common.portal</groupId>
|
||||||
<artifactId>portal-manager</artifactId>
|
<artifactId>portal-manager</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -236,33 +236,33 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- HOME LIBRARY -->
|
<!-- HOME LIBRARY -->
|
||||||
<dependency>
|
<!-- <dependency> -->
|
||||||
<groupId>org.gcube.common</groupId>
|
<!-- <groupId>org.gcube.common</groupId> -->
|
||||||
<artifactId>home-library-model</artifactId>
|
<!-- <artifactId>home-library-model</artifactId> -->
|
||||||
<scope>provided</scope>
|
<!-- <scope>provided</scope> -->
|
||||||
</dependency>
|
<!-- </dependency> -->
|
||||||
<dependency>
|
<!-- <dependency> -->
|
||||||
<groupId>org.gcube.common</groupId>
|
<!-- <groupId>org.gcube.common</groupId> -->
|
||||||
<artifactId>home-library-jcr</artifactId>
|
<!-- <artifactId>home-library-jcr</artifactId> -->
|
||||||
<scope>provided</scope>
|
<!-- <scope>provided</scope> -->
|
||||||
<exclusions>
|
<!-- <exclusions> -->
|
||||||
<exclusion>
|
<!-- <exclusion> -->
|
||||||
<artifactId>asm-debug-all</artifactId>
|
<!-- <artifactId>asm-debug-all</artifactId> -->
|
||||||
<groupId>org.ow2.asm</groupId>
|
<!-- <groupId>org.ow2.asm</groupId> -->
|
||||||
</exclusion>
|
<!-- </exclusion> -->
|
||||||
</exclusions>
|
<!-- </exclusions> -->
|
||||||
</dependency>
|
<!-- </dependency> -->
|
||||||
<dependency>
|
<!-- <dependency> -->
|
||||||
<groupId>org.gcube.common</groupId>
|
<!-- <groupId>org.gcube.common</groupId> -->
|
||||||
<artifactId>home-library</artifactId>
|
<!-- <artifactId>home-library</artifactId> -->
|
||||||
<scope>provided</scope>
|
<!-- <scope>provided</scope> -->
|
||||||
<exclusions>
|
<!-- <exclusions> -->
|
||||||
<exclusion>
|
<!-- <exclusion> -->
|
||||||
<artifactId>asm-all</artifactId>
|
<!-- <artifactId>asm-all</artifactId> -->
|
||||||
<groupId>asm</groupId>
|
<!-- <groupId>asm</groupId> -->
|
||||||
</exclusion>
|
<!-- </exclusion> -->
|
||||||
</exclusions>
|
<!-- </exclusions> -->
|
||||||
</dependency>
|
<!-- </dependency> -->
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.portlet</groupId>
|
<groupId>javax.portlet</groupId>
|
||||||
|
@ -278,20 +278,15 @@
|
||||||
|
|
||||||
<!-- LOGGER -->
|
<!-- LOGGER -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>log4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>log4j</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-log4j12</artifactId>
|
<artifactId>slf4j-log4j12</artifactId>
|
||||||
<scope>runtime</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>slf4j-api</artifactId>
|
|
||||||
<scope>runtime</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
|
|
|
@ -31,7 +31,6 @@ import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent.Download
|
||||||
import org.gcube.portlets.user.workspace.client.event.FileDownloadEventHandler;
|
import org.gcube.portlets.user.workspace.client.event.FileDownloadEventHandler;
|
||||||
import org.gcube.portlets.user.workspace.client.event.FileUploadEvent;
|
import org.gcube.portlets.user.workspace.client.event.FileUploadEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.FileUploadEventHandler;
|
import org.gcube.portlets.user.workspace.client.event.FileUploadEventHandler;
|
||||||
import org.gcube.portlets.user.workspace.client.event.FilterScopeEvent;
|
|
||||||
import org.gcube.portlets.user.workspace.client.event.GetFolderLinkEvent;
|
import org.gcube.portlets.user.workspace.client.event.GetFolderLinkEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.GetInfoEvent;
|
import org.gcube.portlets.user.workspace.client.event.GetInfoEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.GetInfoEventHandler;
|
import org.gcube.portlets.user.workspace.client.event.GetInfoEventHandler;
|
||||||
|
@ -39,11 +38,10 @@ import org.gcube.portlets.user.workspace.client.event.GetPublicLinkEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.GetPublicLinkEventHandler;
|
import org.gcube.portlets.user.workspace.client.event.GetPublicLinkEventHandler;
|
||||||
import org.gcube.portlets.user.workspace.client.event.ImagePreviewEvent;
|
import org.gcube.portlets.user.workspace.client.event.ImagePreviewEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.ImagePreviewEventHandler;
|
import org.gcube.portlets.user.workspace.client.event.ImagePreviewEventHandler;
|
||||||
|
import org.gcube.portlets.user.workspace.client.event.LoadTreeEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.MoveItemsEvent;
|
import org.gcube.portlets.user.workspace.client.event.MoveItemsEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.OpenContextMenuTreeEvent;
|
import org.gcube.portlets.user.workspace.client.event.OpenContextMenuTreeEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.OpenContextMenuTreeEventHandler;
|
import org.gcube.portlets.user.workspace.client.event.OpenContextMenuTreeEventHandler;
|
||||||
import org.gcube.portlets.user.workspace.client.event.OpenReportsEvent;
|
|
||||||
import org.gcube.portlets.user.workspace.client.event.OpenReportsEventHandler;
|
|
||||||
import org.gcube.portlets.user.workspace.client.event.OpenUrlEvent;
|
import org.gcube.portlets.user.workspace.client.event.OpenUrlEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.RefreshFolderEvent;
|
import org.gcube.portlets.user.workspace.client.event.RefreshFolderEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.RenameItemEvent;
|
import org.gcube.portlets.user.workspace.client.event.RenameItemEvent;
|
||||||
|
@ -69,8 +67,6 @@ import org.gcube.portlets.user.workspace.client.gridevent.GridElementUnSelectedE
|
||||||
import org.gcube.portlets.user.workspace.client.gridevent.GridElementUnSelectedEventHandler;
|
import org.gcube.portlets.user.workspace.client.gridevent.GridElementUnSelectedEventHandler;
|
||||||
import org.gcube.portlets.user.workspace.client.gridevent.GridRefreshEvent;
|
import org.gcube.portlets.user.workspace.client.gridevent.GridRefreshEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.gridevent.GridRefreshEventHandler;
|
import org.gcube.portlets.user.workspace.client.gridevent.GridRefreshEventHandler;
|
||||||
import org.gcube.portlets.user.workspace.client.gridevent.LoadAllScopeEvent;
|
|
||||||
import org.gcube.portlets.user.workspace.client.gridevent.LoadAllScopeEventHandler;
|
|
||||||
import org.gcube.portlets.user.workspace.client.gridevent.LoadBreadcrumbEvent;
|
import org.gcube.portlets.user.workspace.client.gridevent.LoadBreadcrumbEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.gridevent.LoadBreadcrumbEventHandler;
|
import org.gcube.portlets.user.workspace.client.gridevent.LoadBreadcrumbEventHandler;
|
||||||
import org.gcube.portlets.user.workspace.client.gridevent.MoveItemsGEvent;
|
import org.gcube.portlets.user.workspace.client.gridevent.MoveItemsGEvent;
|
||||||
|
@ -79,8 +75,6 @@ import org.gcube.portlets.user.workspace.client.gridevent.PathElementSelectedEve
|
||||||
import org.gcube.portlets.user.workspace.client.gridevent.PathElementSelectedEventHandler;
|
import org.gcube.portlets.user.workspace.client.gridevent.PathElementSelectedEventHandler;
|
||||||
import org.gcube.portlets.user.workspace.client.gridevent.SaveSmartFolderEvent;
|
import org.gcube.portlets.user.workspace.client.gridevent.SaveSmartFolderEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.gridevent.SaveSmartFolderEventHandler;
|
import org.gcube.portlets.user.workspace.client.gridevent.SaveSmartFolderEventHandler;
|
||||||
import org.gcube.portlets.user.workspace.client.gridevent.ScopeChangeEvent;
|
|
||||||
import org.gcube.portlets.user.workspace.client.gridevent.ScopeChangeEventHandler;
|
|
||||||
import org.gcube.portlets.user.workspace.client.gridevent.SearchItemByIdEvent;
|
import org.gcube.portlets.user.workspace.client.gridevent.SearchItemByIdEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.gridevent.SearchItemByIdEventHandler;
|
import org.gcube.portlets.user.workspace.client.gridevent.SearchItemByIdEventHandler;
|
||||||
import org.gcube.portlets.user.workspace.client.gridevent.SearchTextEvent;
|
import org.gcube.portlets.user.workspace.client.gridevent.SearchTextEvent;
|
||||||
|
@ -101,7 +95,6 @@ import org.gcube.portlets.user.workspace.client.model.FileGridModel;
|
||||||
import org.gcube.portlets.user.workspace.client.model.FileModel;
|
import org.gcube.portlets.user.workspace.client.model.FileModel;
|
||||||
import org.gcube.portlets.user.workspace.client.model.FileVersionModel;
|
import org.gcube.portlets.user.workspace.client.model.FileVersionModel;
|
||||||
import org.gcube.portlets.user.workspace.client.model.FolderModel;
|
import org.gcube.portlets.user.workspace.client.model.FolderModel;
|
||||||
import org.gcube.portlets.user.workspace.client.model.ScopeModel;
|
|
||||||
import org.gcube.portlets.user.workspace.client.view.WorkspaceFeaturesView;
|
import org.gcube.portlets.user.workspace.client.view.WorkspaceFeaturesView;
|
||||||
import org.gcube.portlets.user.workspace.client.view.WorkspaceQuotesView;
|
import org.gcube.portlets.user.workspace.client.view.WorkspaceQuotesView;
|
||||||
import org.gcube.portlets.user.workspace.client.view.WorskpacePortlet;
|
import org.gcube.portlets.user.workspace.client.view.WorskpacePortlet;
|
||||||
|
@ -318,16 +311,6 @@ public class AppController implements SubscriberInterface {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//********EVENTS TO NOTIFY SUBSCRIBERS
|
|
||||||
eventBus.addHandler(OpenReportsEvent.TYPE, new OpenReportsEventHandler() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClickOpenReports(OpenReportsEvent openReportsEvent) {
|
|
||||||
|
|
||||||
AppControllerExplorer.getEventBus().fireEvent(new OpenReportsEvent(openReportsEvent.getSourceFileModel()));
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
eventBus.addHandler(GetPublicLinkEvent.TYPE, new GetPublicLinkEventHandler() {
|
eventBus.addHandler(GetPublicLinkEvent.TYPE, new GetPublicLinkEventHandler() {
|
||||||
|
|
||||||
|
@ -340,8 +323,6 @@ public class AppController implements SubscriberInterface {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
eventBus.addHandler(AccountingHistoryEvent.TYPE, new AccountingHistoryEventHandler() {
|
eventBus.addHandler(AccountingHistoryEvent.TYPE, new AccountingHistoryEventHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -484,52 +465,6 @@ public class AppController implements SubscriberInterface {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
eventBus.addHandler(LoadAllScopeEvent.TYPE, new LoadAllScopeEventHandler() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadScopes(LoadAllScopeEvent loadAllScopeEvent) {
|
|
||||||
doLoadAllScope();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void doLoadAllScope() {
|
|
||||||
|
|
||||||
appContrExplorer.getRpcWorkspaceService().getAllScope(new AsyncCallback<List<ScopeModel>>() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Throwable caught) {
|
|
||||||
new MessageBoxAlert("Error", ConstantsExplorer.SERVER_ERROR + " getting all scope." +ConstantsExplorer.TRY_AGAIN, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(List<ScopeModel> result) {
|
|
||||||
|
|
||||||
if(result!=null && result.size()>0){
|
|
||||||
wsPortlet.getSearchAndFilterContainer().setListScope(result);
|
|
||||||
wsPortlet.getSearchAndFilterContainer().selectScopeByIndex(0); //select first scope
|
|
||||||
}
|
|
||||||
else
|
|
||||||
new MessageBoxAlert("Error", ConstantsExplorer.SERVER_ERROR + " getting all scope. No scope available. " +ConstantsExplorer.TRY_AGAIN, null);
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
eventBus.addHandler(ScopeChangeEvent.TYPE, new ScopeChangeEventHandler() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadScope(ScopeChangeEvent scopeChangeEvent) {
|
|
||||||
doLoadScope(scopeChangeEvent.getScopeId());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void doLoadScope(String scopeId) {
|
|
||||||
AppControllerExplorer.getEventBus().fireEvent(new FilterScopeEvent(scopeId));
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
eventBus.addHandler(SaveSmartFolderEvent.TYPE, new SaveSmartFolderEventHandler() {
|
eventBus.addHandler(SaveSmartFolderEvent.TYPE, new SaveSmartFolderEventHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -599,9 +534,7 @@ public class AppController implements SubscriberInterface {
|
||||||
if(wsPortlet.getGxtCardLayoutResultPanel().getActivePanel() instanceof GxtItemsPanel){ //If active panel is panel with file items
|
if(wsPortlet.getGxtCardLayoutResultPanel().getActivePanel() instanceof GxtItemsPanel){ //If active panel is panel with file items
|
||||||
|
|
||||||
wsPortlet.getGridGroupContainer().setBorderAsOnSearch(true);
|
wsPortlet.getGridGroupContainer().setBorderAsOnSearch(true);
|
||||||
|
|
||||||
wsPortlet.getGridGroupContainer().mask(ConstantsExplorer.LOADING,ConstantsExplorer.LOADINGSTYLE);
|
wsPortlet.getGridGroupContainer().mask(ConstantsExplorer.LOADING,ConstantsExplorer.LOADINGSTYLE);
|
||||||
|
|
||||||
appContrExplorer.getRpcWorkspaceService().getItemsBySearchName(textSearch, folderId, new AsyncCallback<List<FileGridModel>>() {
|
appContrExplorer.getRpcWorkspaceService().getItemsBySearchName(textSearch, folderId, new AsyncCallback<List<FileGridModel>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -789,13 +722,6 @@ public class AppController implements SubscriberInterface {
|
||||||
parent = wsPortlet.getGridGroupContainer().getCurrentFolderView();
|
parent = wsPortlet.getGridGroupContainer().getCurrentFolderView();
|
||||||
GWT.log("Search is not active get parent item for uploading from CurrentFolderView: " +parent.getName());
|
GWT.log("Search is not active get parent item for uploading from CurrentFolderView: " +parent.getName());
|
||||||
}
|
}
|
||||||
// }else if(wsPortlet.getGridGroupContainer().getCurrentFolderView()!=null){
|
|
||||||
// parent = wsPortlet.getGridGroupContainer().getCurrentFolderView();
|
|
||||||
// GWT.log("get parent item for uploading from CurrentFolderView: " +parent.getName());
|
|
||||||
// }else if(wsPortlet.getToolBarPath().getLastParent()!=null){
|
|
||||||
// parent = wsPortlet.getToolBarPath().getLastParent();
|
|
||||||
// GWT.log("get parent item for uploading from breadcrumb: " +parent.getName());
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
else{ //IF IS SEARCH ACTIVE
|
else{ //IF IS SEARCH ACTIVE
|
||||||
|
|
||||||
|
@ -849,11 +775,8 @@ public class AppController implements SubscriberInterface {
|
||||||
}
|
}
|
||||||
|
|
||||||
final FileModel target = parent;
|
final FileModel target = parent;
|
||||||
|
|
||||||
final int size = event.getListTarget().size();
|
final int size = event.getListTarget().size();
|
||||||
|
|
||||||
List<? extends FileModel> targets = event.getListTarget();
|
List<? extends FileModel> targets = event.getListTarget();
|
||||||
|
|
||||||
final List<FileModel> clearTargets = new ArrayList<FileModel>(targets);
|
final List<FileModel> clearTargets = new ArrayList<FileModel>(targets);
|
||||||
|
|
||||||
//IGNORING SHARED FOLDER
|
//IGNORING SHARED FOLDER
|
||||||
|
@ -896,10 +819,8 @@ public class AppController implements SubscriberInterface {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent clickEvent) {
|
public void onClick(ClickEvent clickEvent) {
|
||||||
|
|
||||||
confirm.loader("Deleting "+diff+ " items, please wait");
|
confirm.loader("Deleting "+diff+ " items, please wait");
|
||||||
// wsPortlet.getGridGroupContainer().mask("Deleting",ConstantsExplorer.LOADINGSTYLE);
|
|
||||||
|
|
||||||
|
|
||||||
appContrExplorer.getRpcWorkspaceService().deleteListItemsForIds(ids, new AsyncCallback<List<GarbageItem>>() {
|
appContrExplorer.getRpcWorkspaceService().deleteListItemsForIds(ids, new AsyncCallback<List<GarbageItem>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -992,10 +913,6 @@ public class AppController implements SubscriberInterface {
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
private void accountingSetItemAsRead(boolean read) {
|
|
||||||
wsPortlet.getToolBarItemDetails().setRead(read);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Do element grid selected.
|
* Do element grid selected.
|
||||||
|
@ -1178,11 +1095,6 @@ public class AppController implements SubscriberInterface {
|
||||||
wsPortlet.getToolBarItemDetails().updateAddAdministatorInfo(AppControllerExplorer.myLogin, res.get(0));
|
wsPortlet.getToolBarItemDetails().updateAddAdministatorInfo(AppControllerExplorer.myLogin, res.get(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if(res!=null && res.size()>0){
|
|
||||||
// wsPortlet.getToolBarItemDetails().updateACLInfo(res.get(0));
|
|
||||||
// wsPortlet.getToolBarItemDetails().updateAddAdministatorInfo(AppControllerExplorer.myLogin, res.get(0));
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1260,7 +1172,7 @@ public class AppController implements SubscriberInterface {
|
||||||
|
|
||||||
dnd.addWorkspaceUploadNotificationListener(listener);
|
dnd.addWorkspaceUploadNotificationListener(listener);
|
||||||
|
|
||||||
eventBus.fireEvent(new LoadAllScopeEvent()); //LOAD ALL SCOPE EVENT
|
AppControllerExplorer.getEventBus().fireEvent(new LoadTreeEvent(true)); //LOAD THE TREE
|
||||||
}
|
}
|
||||||
|
|
||||||
final boolean searchingForItemId = isSearchForItemId;
|
final boolean searchingForItemId = isSearchForItemId;
|
||||||
|
@ -1357,6 +1269,7 @@ public class AppController implements SubscriberInterface {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//TODO CHECK IF THIS MUST REMAIN COMMENTED
|
||||||
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
|
@ -1615,7 +1528,6 @@ public class AppController implements SubscriberInterface {
|
||||||
|
|
||||||
GWT.log("Add to store: "+result);
|
GWT.log("Add to store: "+result);
|
||||||
wsPortlet.getGridGroupContainer().addToStore(result);
|
wsPortlet.getGridGroupContainer().addToStore(result);
|
||||||
// wsPortlet.getGridGroupContainer().unmask();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1741,57 +1653,8 @@ public class AppController implements SubscriberInterface {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void smartFolderSelected(final String folderId, final GXTCategorySmartFolder category) {
|
public void smartFolderSelected(final String folderId, final GXTCategorySmartFolder category) {
|
||||||
|
|
||||||
selectedSmartFolderId = folderId;
|
Window.alert("The method smartFolderSelected has been removed");
|
||||||
selectedSmartFolderCategory = category;
|
|
||||||
|
|
||||||
GWT.log("Smart folder selected, folderId: " + selectedSmartFolderId);
|
|
||||||
GWT.log("Smart folder selected, category: " + selectedSmartFolderCategory);
|
|
||||||
|
|
||||||
wsPortlet.getGridGroupContainer().mask(ConstantsExplorer.LOADING,ConstantsExplorer.LOADINGSTYLE);
|
|
||||||
|
|
||||||
wsPortlet.getGridGroupContainer().setBorderAsOnSearch(true);
|
|
||||||
|
|
||||||
if (folderId != null && !folderId.isEmpty()) {
|
|
||||||
|
|
||||||
appContrExplorer.getRpcWorkspaceService().getSmartFolderResultsById(folderId,new AsyncCallback<List<FileGridModel>>() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Throwable caught) {
|
|
||||||
new MessageBoxAlert("Error", ConstantsExplorer.SERVER_ERROR + " getting smart folders. " +ConstantsExplorer.TRY_AGAIN, null);
|
|
||||||
wsPortlet.getGridGroupContainer().unmask();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(List<FileGridModel> result) {
|
|
||||||
wsPortlet.getSearchAndFilterContainer().setSearchActive(true);
|
|
||||||
// setSearchActive(true);
|
|
||||||
wsPortlet.getGridGroupContainer().unmask();
|
|
||||||
wsPortlet.getGridGroupContainer().updateStore(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
|
|
||||||
if (category != null) {
|
|
||||||
|
|
||||||
appContrExplorer.getRpcWorkspaceService().getSmartFolderResultsByCategory(category, new AsyncCallback<List<FileGridModel>>() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Throwable caught) {
|
|
||||||
new MessageBoxAlert("Error", ConstantsExplorer.SERVER_ERROR + " getting smart folder results by category. " +ConstantsExplorer.TRY_AGAIN, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(List<FileGridModel> result) {
|
|
||||||
wsPortlet.getGridGroupContainer().unmask();
|
|
||||||
wsPortlet.getGridGroupContainer().updateStore(result);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2230,7 +2093,6 @@ public class AppController implements SubscriberInterface {
|
||||||
public void onSuccess(TrashOperationContent operationResult) {
|
public void onSuccess(TrashOperationContent operationResult) {
|
||||||
|
|
||||||
WindowTrash.getInstance().executeOperationOnTrashContainer(operationResult.getListTrashIds(), operationResult.getOperation());
|
WindowTrash.getInstance().executeOperationOnTrashContainer(operationResult.getListTrashIds(), operationResult.getOperation());
|
||||||
|
|
||||||
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemDetails().updateTrashIcon(WindowTrash.getInstance().getTrashedFiles().size()>0);
|
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemDetails().updateTrashIcon(WindowTrash.getInstance().getTrashedFiles().size()>0);
|
||||||
|
|
||||||
//SHOW POSSIBLY ERRORS
|
//SHOW POSSIBLY ERRORS
|
||||||
|
@ -2264,7 +2126,6 @@ public class AppController implements SubscriberInterface {
|
||||||
public void onSuccess(TrashContent operationResult) {
|
public void onSuccess(TrashContent operationResult) {
|
||||||
|
|
||||||
WindowTrash.getInstance().updateTrashContainer(operationResult.getTrashContent());
|
WindowTrash.getInstance().updateTrashContainer(operationResult.getTrashContent());
|
||||||
|
|
||||||
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemDetails().updateTrashIcon(operationResult.getTrashContent().size()>0);
|
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemDetails().updateTrashIcon(operationResult.getTrashContent().size()>0);
|
||||||
|
|
||||||
//SHOW POSSIBLY ERRORS
|
//SHOW POSSIBLY ERRORS
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
package org.gcube.portlets.user.workspace.client.gridevent;
|
|
||||||
|
|
||||||
import com.google.gwt.event.shared.GwtEvent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa{@literal @}isti.cnr.it
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class LoadAllScopeEvent extends GwtEvent<LoadAllScopeEventHandler> {
|
|
||||||
public static Type<LoadAllScopeEventHandler> TYPE = new Type<LoadAllScopeEventHandler>();
|
|
||||||
|
|
||||||
public LoadAllScopeEvent() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Type<LoadAllScopeEventHandler> getAssociatedType() {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return TYPE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void dispatch(LoadAllScopeEventHandler handler) {
|
|
||||||
handler.onLoadScopes(this);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
package org.gcube.portlets.user.workspace.client.gridevent;
|
|
||||||
|
|
||||||
import com.google.gwt.event.shared.EventHandler;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa{@literal @}isti.cnr.it
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public interface LoadAllScopeEventHandler extends EventHandler {
|
|
||||||
void onLoadScopes(LoadAllScopeEvent loadAllScopeEvent);
|
|
||||||
}
|
|
|
@ -1,35 +1,35 @@
|
||||||
package org.gcube.portlets.user.workspace.client.gridevent;
|
//package org.gcube.portlets.user.workspace.client.gridevent;
|
||||||
|
//
|
||||||
import com.google.gwt.event.shared.GwtEvent;
|
//import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa{@literal @}isti.cnr.it
|
// * @author Francesco Mangiacrapa francesco.mangiacrapa{@literal @}isti.cnr.it
|
||||||
*
|
// *
|
||||||
*/
|
// */
|
||||||
public class ScopeChangeEvent extends GwtEvent<ScopeChangeEventHandler> {
|
//public class ScopeChangeEvent extends GwtEvent<ScopeChangeEventHandler> {
|
||||||
public static Type<ScopeChangeEventHandler> TYPE = new Type<ScopeChangeEventHandler>();
|
// public static Type<ScopeChangeEventHandler> TYPE = new Type<ScopeChangeEventHandler>();
|
||||||
|
//
|
||||||
private String scopeId;
|
// private String scopeId;
|
||||||
|
//
|
||||||
|
//
|
||||||
public ScopeChangeEvent(String scopeId) {
|
// public ScopeChangeEvent(String scopeId) {
|
||||||
this.scopeId = scopeId;
|
// this.scopeId = scopeId;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public Type<ScopeChangeEventHandler> getAssociatedType() {
|
// public Type<ScopeChangeEventHandler> getAssociatedType() {
|
||||||
// TODO Auto-generated method stub
|
// // TODO Auto-generated method stub
|
||||||
return TYPE;
|
// return TYPE;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
protected void dispatch(ScopeChangeEventHandler handler) {
|
// protected void dispatch(ScopeChangeEventHandler handler) {
|
||||||
handler.onLoadScope(this);
|
// handler.onLoadScope(this);
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public String getScopeId() {
|
// public String getScopeId() {
|
||||||
return scopeId;
|
// return scopeId;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
//}
|
|
@ -1,11 +1,11 @@
|
||||||
package org.gcube.portlets.user.workspace.client.gridevent;
|
//package org.gcube.portlets.user.workspace.client.gridevent;
|
||||||
|
//
|
||||||
import com.google.gwt.event.shared.EventHandler;
|
//import com.google.gwt.event.shared.EventHandler;
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa{@literal @}isti.cnr.it
|
// * @author Francesco Mangiacrapa francesco.mangiacrapa{@literal @}isti.cnr.it
|
||||||
*
|
// *
|
||||||
*/
|
// */
|
||||||
public interface ScopeChangeEventHandler extends EventHandler {
|
//public interface ScopeChangeEventHandler extends EventHandler {
|
||||||
void onLoadScope(ScopeChangeEvent scopeChangeEvent);
|
// void onLoadScope(ScopeChangeEvent scopeChangeEvent);
|
||||||
}
|
//}
|
||||||
|
|
|
@ -10,7 +10,6 @@ import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent.DownloadType;
|
import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent.DownloadType;
|
||||||
import org.gcube.portlets.user.workspace.client.event.ImagePreviewEvent;
|
import org.gcube.portlets.user.workspace.client.event.ImagePreviewEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.OpenContextMenuTreeEvent;
|
import org.gcube.portlets.user.workspace.client.event.OpenContextMenuTreeEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.OpenReportsEvent;
|
|
||||||
import org.gcube.portlets.user.workspace.client.gridevent.DoubleClickElementSelectedEvent;
|
import org.gcube.portlets.user.workspace.client.gridevent.DoubleClickElementSelectedEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.gridevent.GridElementSelectedEvent;
|
import org.gcube.portlets.user.workspace.client.gridevent.GridElementSelectedEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.gridevent.GridElementUnSelectedEvent;
|
import org.gcube.portlets.user.workspace.client.gridevent.GridElementUnSelectedEvent;
|
||||||
|
@ -317,11 +316,6 @@ public class GxtGridFilterGroupPanel extends LayoutContainer {
|
||||||
case EXTERNAL_URL:
|
case EXTERNAL_URL:
|
||||||
AppController.getEventBus().fireEvent(new ShowUrlEvent(target));
|
AppController.getEventBus().fireEvent(new ShowUrlEvent(target));
|
||||||
break;
|
break;
|
||||||
case REPORT_TEMPLATE:
|
|
||||||
case REPORT:
|
|
||||||
AppController.getEventBus().fireEvent(new OpenReportsEvent(target));
|
|
||||||
break;
|
|
||||||
case QUERY:
|
|
||||||
case TIME_SERIES:
|
case TIME_SERIES:
|
||||||
case METADATA:
|
case METADATA:
|
||||||
case WORKFLOW_REPORT:
|
case WORKFLOW_REPORT:
|
||||||
|
@ -626,15 +620,15 @@ public class GxtGridFilterGroupPanel extends LayoutContainer {
|
||||||
int percent;
|
int percent;
|
||||||
if(i==1) {
|
if(i==1) {
|
||||||
percent = theWidth*30/100;
|
percent = theWidth*30/100;
|
||||||
GWT.log("i is: "+i+" percent is "+percent);
|
//GWT.log("i is: "+i+" percent is "+percent);
|
||||||
col.setWidth(percent);
|
col.setWidth(percent);
|
||||||
}else if (i==cm.getColumnCount()-1){
|
}else if (i==cm.getColumnCount()-1){
|
||||||
percent = theWidth*10/100;
|
percent = theWidth*10/100;
|
||||||
GWT.log("i is last column: "+i+" percent is "+percent);
|
//GWT.log("i is last column: "+i+" percent is "+percent);
|
||||||
col.setWidth(percent);
|
col.setWidth(percent);
|
||||||
}else {
|
}else {
|
||||||
percent = theWidth*20/100;
|
percent = theWidth*20/100;
|
||||||
GWT.log("i is: "+i+" percent is "+percent);
|
//GWT.log("i is: "+i+" percent is "+percent);
|
||||||
col.setWidth(percent);
|
col.setWidth(percent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,15 +4,12 @@ import java.util.List;
|
||||||
|
|
||||||
import org.gcube.portlets.user.workspace.client.AppController;
|
import org.gcube.portlets.user.workspace.client.AppController;
|
||||||
import org.gcube.portlets.user.workspace.client.ConstantsPortlet;
|
import org.gcube.portlets.user.workspace.client.ConstantsPortlet;
|
||||||
import org.gcube.portlets.user.workspace.client.gridevent.ScopeChangeEvent;
|
|
||||||
import org.gcube.portlets.user.workspace.client.gridevent.SearchTextEvent;
|
import org.gcube.portlets.user.workspace.client.gridevent.SearchTextEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.model.ScopeModel;
|
import org.gcube.portlets.user.workspace.client.model.ScopeModel;
|
||||||
import org.gcube.portlets.user.workspace.client.view.GxtComboBox;
|
import org.gcube.portlets.user.workspace.client.view.GxtComboBox;
|
||||||
import org.gcube.portlets.user.workspace.client.view.toolbars.GxtBreadcrumbPathPanel;
|
import org.gcube.portlets.user.workspace.client.view.toolbars.GxtBreadcrumbPathPanel;
|
||||||
|
|
||||||
import com.extjs.gxt.ui.client.Style.VerticalAlignment;
|
import com.extjs.gxt.ui.client.Style.VerticalAlignment;
|
||||||
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
|
|
||||||
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
|
|
||||||
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
|
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
|
||||||
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
||||||
import com.extjs.gxt.ui.client.widget.form.ComboBox;
|
import com.extjs.gxt.ui.client.widget.form.ComboBox;
|
||||||
|
@ -189,17 +186,17 @@ public class GxtSeachAndFilterPanel extends LayoutContainer {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
this.cbViewScope.addSelectionChangedListener(new SelectionChangedListener<ScopeModel>() {
|
// this.cbViewScope.addSelectionChangedListener(new SelectionChangedListener<ScopeModel>() {
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void selectionChanged(SelectionChangedEvent<ScopeModel> se) {
|
// public void selectionChanged(SelectionChangedEvent<ScopeModel> se) {
|
||||||
|
//
|
||||||
ScopeModel scope = se.getSelectedItem();
|
// ScopeModel scope = se.getSelectedItem();
|
||||||
|
//
|
||||||
AppController.getEventBus().fireEvent(new ScopeChangeEvent(scope.getId()));
|
// AppController.getEventBus().fireEvent(new ScopeChangeEvent(scope.getId()));
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,11 +12,11 @@ import org.gcube.portlets.user.workspace.client.interfaces.GXTFolderItemTypeEnum
|
||||||
import org.gcube.portlets.user.workspace.client.model.FileModel;
|
import org.gcube.portlets.user.workspace.client.model.FileModel;
|
||||||
import org.gcube.portlets.user.workspace.client.resources.Resources;
|
import org.gcube.portlets.user.workspace.client.resources.Resources;
|
||||||
import org.gcube.portlets.user.workspace.client.util.GetPermissionIconByACL;
|
import org.gcube.portlets.user.workspace.client.util.GetPermissionIconByACL;
|
||||||
|
import org.gcube.portlets.user.workspace.shared.WorkspaceTrashOperation;
|
||||||
|
import org.gcube.portlets.user.workspace.shared.WorkspaceVersioningOperation;
|
||||||
import org.gcube.portlets.widgets.workspacesharingwidget.shared.ExtendedWorkspaceACL;
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.ExtendedWorkspaceACL;
|
||||||
import org.gcube.portlets.widgets.workspacesharingwidget.shared.WorkspaceACL;
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.WorkspaceACL;
|
||||||
import org.gcube.portlets.widgets.workspacesharingwidget.shared.WorkspaceACL.USER_TYPE;
|
import org.gcube.portlets.widgets.workspacesharingwidget.shared.WorkspaceACL.USER_TYPE;
|
||||||
import org.gcube.portlets.user.workspace.shared.WorkspaceTrashOperation;
|
|
||||||
import org.gcube.portlets.user.workspace.shared.WorkspaceVersioningOperation;
|
|
||||||
|
|
||||||
import com.extjs.gxt.ui.client.Style.ButtonScale;
|
import com.extjs.gxt.ui.client.Style.ButtonScale;
|
||||||
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
|
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
|
||||||
|
|
|
@ -630,13 +630,6 @@ public class GxtToolBarItemFunctionality {
|
||||||
case EXTERNAL_URL:
|
case EXTERNAL_URL:
|
||||||
// contextMenu.getItemByItemId(ConstantsExplorer.LNK).setVisible(true);
|
// contextMenu.getItemByItemId(ConstantsExplorer.LNK).setVisible(true);
|
||||||
break;
|
break;
|
||||||
case REPORT_TEMPLATE:
|
|
||||||
// contextMenu.getItemByItemId(ConstantsExplorer.ORT).setVisible(true);
|
|
||||||
break;
|
|
||||||
case REPORT:
|
|
||||||
break;
|
|
||||||
case QUERY:
|
|
||||||
break;
|
|
||||||
case TIME_SERIES:
|
case TIME_SERIES:
|
||||||
break;
|
break;
|
||||||
case PDF_DOCUMENT:
|
case PDF_DOCUMENT:
|
||||||
|
|
|
@ -1,154 +0,0 @@
|
||||||
package org.gcube.portlets.user.workspace.server;
|
|
||||||
|
|
||||||
import static org.gcube.common.authorization.client.Constants.authorizationService;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import javax.websocket.OnClose;
|
|
||||||
import javax.websocket.OnMessage;
|
|
||||||
import javax.websocket.OnOpen;
|
|
||||||
import javax.websocket.Session;
|
|
||||||
import javax.websocket.server.ServerEndpoint;
|
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
|
||||||
import org.gcube.common.authorization.library.provider.UserInfo;
|
|
||||||
import org.gcube.common.homelibrary.home.HomeLibrary;
|
|
||||||
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.util.zip.ZipUtil;
|
|
||||||
import org.gcube.common.portal.PortalContext;
|
|
||||||
import org.gcube.common.scope.api.ScopeProvider;
|
|
||||||
import org.gcube.contentmanagement.blobstorage.service.IClient;
|
|
||||||
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.workspace.client.ConstantsExplorer;
|
|
||||||
|
|
||||||
@ServerEndpoint(value = "/downloadfolder", subprotocols = { "downloadfolder" })
|
|
||||||
public class DownloadFolderWebSocketServer {
|
|
||||||
|
|
||||||
|
|
||||||
protected static Logger _log = Logger.getLogger(DownloadFolderWebSocketServer.class);
|
|
||||||
|
|
||||||
private static Set<Session> peers = Collections.synchronizedSet( new HashSet<Session>() );
|
|
||||||
|
|
||||||
@OnOpen
|
|
||||||
public void onOpen( final Session session ) {
|
|
||||||
_log.debug( "onOpen(" + session.getId() + ")" );
|
|
||||||
peers.add( session );
|
|
||||||
}
|
|
||||||
|
|
||||||
@OnClose
|
|
||||||
public void onClose( final Session session ) {
|
|
||||||
_log.debug( "onClose(" + session.getId() + ")" );
|
|
||||||
peers.remove( session );
|
|
||||||
}
|
|
||||||
|
|
||||||
@OnMessage
|
|
||||||
public void onMessage( final String message, final Session session ) {
|
|
||||||
_log.info( "onMessage(" + message + "," + session.getId() + ")" );
|
|
||||||
for ( final Session peer : peers )
|
|
||||||
{
|
|
||||||
if ( peer.getId().equals( session.getId() ) ) {
|
|
||||||
if (message.startsWith(ConstantsExplorer.DOWNLOAD_WORKSPACE_FOLDER_PROTOCOL_DO_ZIP)) {
|
|
||||||
String itemId = message.split(":")[1];
|
|
||||||
if(itemId==null || itemId.isEmpty()){
|
|
||||||
peer.getAsyncRemote().sendText(ConstantsExplorer.DOWNLOAD_WORKSPACE_FOLDER_PROTOCOL_ERROR_NOT_FOUND);
|
|
||||||
} else {
|
|
||||||
peer.getAsyncRemote().sendText(ConstantsExplorer.DOWNLOAD_WORKSPACE_FOLDER_PROTOCOL_ZIPPING);
|
|
||||||
String username = message.split(":")[2];
|
|
||||||
String absolutePath = zipFolder(itemId, peer, username);
|
|
||||||
peer.getAsyncRemote().sendText(absolutePath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private final static String DEFAULT_ROLE = "OrganizationMember";
|
|
||||||
private static void setAuthorizationToken(String username) throws Exception {
|
|
||||||
|
|
||||||
String scope = "/"+PortalContext.getConfiguration().getInfrastructureName();
|
|
||||||
ScopeProvider.instance.set(scope);
|
|
||||||
_log.debug("calling service token on scope " + scope);
|
|
||||||
List<String> userRoles = new ArrayList<>();
|
|
||||||
userRoles.add(DEFAULT_ROLE);
|
|
||||||
String token = authorizationService().generateUserToken(new UserInfo(username, userRoles), scope);
|
|
||||||
_log.debug("received token: "+token);
|
|
||||||
_log.info("Security token set in session for: "+username + " on " + scope);
|
|
||||||
}
|
|
||||||
|
|
||||||
private String zipFolder(String itemId, Session peer, String username) {
|
|
||||||
|
|
||||||
_log.info("FOLDER DOWNLOAD REQUEST itemId="+itemId + " user=" + username);
|
|
||||||
Workspace wa = null;
|
|
||||||
try {
|
|
||||||
setAuthorizationToken(username);
|
|
||||||
wa = HomeLibrary.getUserWorkspace(username);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
if (wa == null) {
|
|
||||||
peer.getAsyncRemote().sendText(ConstantsExplorer.DOWNLOAD_WORKSPACE_FOLDER_PROTOCOL_ERROR_SESSION_EXPIRED);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
WorkspaceItem item;
|
|
||||||
try {
|
|
||||||
|
|
||||||
item = wa.getItem(itemId);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
_log.error("Requested item "+itemId+" not found",e);
|
|
||||||
peer.getAsyncRemote().sendText(ConstantsExplorer.DOWNLOAD_WORKSPACE_FOLDER_PROTOCOL_ERROR_NOT_FOUND);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (item.getType()) {
|
|
||||||
case SHARED_FOLDER:
|
|
||||||
case FOLDER:{
|
|
||||||
try {
|
|
||||||
File tmpZip = ZipUtil.zipFolder((WorkspaceFolder) item);
|
|
||||||
|
|
||||||
String randomDirName = UUID.randomUUID().toString();
|
|
||||||
StringBuilder sb = new StringBuilder("/").append(randomDirName).append(File.separator).append(item.getName()).append(".zip");
|
|
||||||
String fileNameAndPath = sb.toString();
|
|
||||||
String toReturn = copyFileOnStorageVolatile(tmpZip, fileNameAndPath);
|
|
||||||
_log.info("Deleting tmp zip: " + tmpZip.getAbsolutePath());
|
|
||||||
tmpZip.delete();
|
|
||||||
return toReturn;
|
|
||||||
} catch (Exception e) {
|
|
||||||
_log.error("Error during folder compression "+itemId,e);
|
|
||||||
peer.getAsyncRemote().sendText(ConstantsExplorer.DOWNLOAD_WORKSPACE_FOLDER_PROTOCOL_ERROR_DURING_COMPRESSION);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
_log.error("Error during folder compression "+itemId);
|
|
||||||
peer.getAsyncRemote().sendText(ConstantsExplorer.DOWNLOAD_WORKSPACE_FOLDER_PROTOCOL_ERROR_NOT_A_FOLDER);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@SuppressWarnings("resource")
|
|
||||||
private String copyFileOnStorageVolatile(File source, String fileNameAndPath) throws IOException {
|
|
||||||
String path = fileNameAndPath;
|
|
||||||
_log.info("DownloadFolder Starting copy file on storage volatile: " + path);
|
|
||||||
IClient client=new StorageClient("PortletUser", "Workspace", "downloadFolder", AccessType.SHARED, MemoryType.VOLATILE).getClient();
|
|
||||||
String id = client.put(true).LFile(source.getAbsolutePath()).RFile(path);
|
|
||||||
_log.debug("DownloadFolder Copy file on storage volatile id returned: " + id);
|
|
||||||
String httpUrl = client.getHttpUrl().RFile(path);
|
|
||||||
_log.info("DownloadFolder Copy file on storage volatile is finished, generated http url: " + httpUrl);
|
|
||||||
return httpUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -4,7 +4,6 @@
|
||||||
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
|
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
|
||||||
version="3.0">
|
version="3.0">
|
||||||
|
|
||||||
|
|
||||||
<!-- Default page to serve -->
|
<!-- Default page to serve -->
|
||||||
<welcome-file-list>
|
<welcome-file-list>
|
||||||
<welcome-file>WorkspacePortlet.html</welcome-file>
|
<welcome-file>WorkspacePortlet.html</welcome-file>
|
||||||
|
@ -15,26 +14,11 @@
|
||||||
<servlet-class>org.gcube.portlets.widgets.workspacesharingwidget.server.WorkspaceSharingServiceImpl</servlet-class>
|
<servlet-class>org.gcube.portlets.widgets.workspacesharingwidget.server.WorkspaceSharingServiceImpl</servlet-class>
|
||||||
</servlet>
|
</servlet>
|
||||||
|
|
||||||
<!-- <servlet> -->
|
|
||||||
<!-- <servlet-name>UploadService</servlet-name> -->
|
|
||||||
<!-- <servlet-class>org.gcube.portlets.user.workspace.server.UploadServlet</servlet-class> -->
|
|
||||||
<!-- </servlet> -->
|
|
||||||
|
|
||||||
<!-- <servlet> -->
|
|
||||||
<!-- <servlet-name>LocalUploadService</servlet-name> -->
|
|
||||||
<!-- <servlet-class>org.gcube.portlets.user.workspace.server.LocalUploadServlet</servlet-class> -->
|
|
||||||
<!-- </servlet> -->
|
|
||||||
|
|
||||||
<servlet>
|
<servlet>
|
||||||
<servlet-name>DownloadService</servlet-name>
|
<servlet-name>DownloadService</servlet-name>
|
||||||
<servlet-class>org.gcube.portlets.user.workspace.server.DownloadServlet</servlet-class>
|
<servlet-class>org.gcube.portlets.user.workspace.server.DownloadServlet</servlet-class>
|
||||||
</servlet>
|
</servlet>
|
||||||
|
|
||||||
<!-- <servlet> -->
|
|
||||||
<!-- <servlet-name>DownloadFolderServlet</servlet-name> -->
|
|
||||||
<!-- <servlet-class>org.gcube.portlets.user.workspace.server.DownloadFolderServlet</servlet-class> -->
|
|
||||||
<!-- </servlet> -->
|
|
||||||
|
|
||||||
<!-- Servlets -->
|
<!-- Servlets -->
|
||||||
<servlet>
|
<servlet>
|
||||||
<servlet-name>WorkspaceService</servlet-name>
|
<servlet-name>WorkspaceService</servlet-name>
|
||||||
|
@ -163,33 +147,16 @@
|
||||||
<url-pattern>/workspace/checksession</url-pattern>
|
<url-pattern>/workspace/checksession</url-pattern>
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
|
|
||||||
<!-- <servlet-mapping> -->
|
|
||||||
<!-- <servlet-name>LocalUploadService</servlet-name> -->
|
|
||||||
<!-- <url-pattern>/workspace/LocalUploadService</url-pattern> -->
|
|
||||||
<!-- </servlet-mapping> -->
|
|
||||||
|
|
||||||
<servlet-mapping>
|
<servlet-mapping>
|
||||||
<servlet-name>DownloadService</servlet-name>
|
<servlet-name>DownloadService</servlet-name>
|
||||||
<url-pattern>/workspace/DownloadService</url-pattern>
|
<url-pattern>/workspace/DownloadService</url-pattern>
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
|
|
||||||
<!-- <servlet-mapping> -->
|
|
||||||
<!-- <servlet-name>DownloadFolderServlet</servlet-name> -->
|
|
||||||
<!-- <url-pattern>/workspace/DownloadFolderServlet</url-pattern> -->
|
|
||||||
<!-- </servlet-mapping> -->
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <servlet-mapping> -->
|
|
||||||
<!-- <servlet-name>UploadService</servlet-name> -->
|
|
||||||
<!-- <url-pattern>/workspace/UploadService</url-pattern> -->
|
|
||||||
<!-- </servlet-mapping> -->
|
|
||||||
|
|
||||||
<servlet-mapping>
|
<servlet-mapping>
|
||||||
<servlet-name>workspacesharing</servlet-name>
|
<servlet-name>workspacesharing</servlet-name>
|
||||||
<url-pattern>/workspace/workspacesharing</url-pattern>
|
<url-pattern>/workspace/workspacesharing</url-pattern>
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
|
|
||||||
|
|
||||||
<servlet-mapping>
|
<servlet-mapping>
|
||||||
<servlet-name>jUnitHostImpl</servlet-name>
|
<servlet-name>jUnitHostImpl</servlet-name>
|
||||||
<url-pattern>/org.gcube.portlets.user.workspace.WorkspacePortletJUnit/junithost/*</url-pattern>
|
<url-pattern>/org.gcube.portlets.user.workspace.WorkspacePortletJUnit/junithost/*</url-pattern>
|
||||||
|
@ -204,24 +171,9 @@
|
||||||
<url-pattern>/org.gcube.portlets.user.workspace.WorkspacePortletJUnit/DownloadService</url-pattern>
|
<url-pattern>/org.gcube.portlets.user.workspace.WorkspacePortletJUnit/DownloadService</url-pattern>
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
|
|
||||||
<!-- <servlet-mapping> -->
|
|
||||||
<!-- <servlet-name>WorkspaceService</servlet-name> -->
|
|
||||||
<!-- <url-pattern>/org.gcube.portlets.user.workspace.WorkspacePortletJUnit/WorkspaceService</url-pattern> -->
|
|
||||||
<!-- </servlet-mapping> -->
|
|
||||||
|
|
||||||
<servlet-mapping>
|
<servlet-mapping>
|
||||||
<servlet-name>ImageService</servlet-name>
|
<servlet-name>ImageService</servlet-name>
|
||||||
<url-pattern>/org.gcube.portlets.user.workspace.WorkspacePortletJUnit/ImageService</url-pattern>
|
<url-pattern>/org.gcube.portlets.user.workspace.WorkspacePortletJUnit/ImageService</url-pattern>
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
|
|
||||||
<!-- <servlet-mapping> -->
|
|
||||||
<!-- <servlet-name>UploadService</servlet-name> -->
|
|
||||||
<!-- <url-pattern>/org.gcube.portlets.user.workspace.WorkspacePortletJUnit/UploadService</url-pattern> -->
|
|
||||||
<!-- </servlet-mapping> -->
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <servlet-mapping> -->
|
|
||||||
<!-- <servlet-name>quicktourServlet</servlet-name> -->
|
|
||||||
<!-- <url-pattern>/workspace/quicktourServlet</url-pattern> -->
|
|
||||||
<!-- </servlet-mapping> -->
|
|
||||||
</web-app>
|
</web-app>
|
||||||
|
|
Loading…
Reference in New Issue