Moved serviceInstance to perform RPC calls in WorkspaceExplorerConstants
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-explorer@121732 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
acc6a8ae4c
commit
4ef6c85f64
|
@ -1,9 +1,15 @@
|
|||
package org.gcube.portlets.widgets.wsexplorer.client;
|
||||
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.rpc.WorkspaceExplorerService;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.rpc.WorkspaceExplorerServiceAsync;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
|
||||
/**
|
||||
* The Class WorkspaceExplorerConstants.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Jun 30, 2015
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* Dec 9, 2015
|
||||
*/
|
||||
public class WorkspaceExplorerConstants {
|
||||
public static final String SPECIAL_FOLDERS_NAME = "MySpecialFolders";
|
||||
|
@ -26,4 +32,6 @@ public class WorkspaceExplorerConstants {
|
|||
public static final int WIDHT_DIALOG = 730;
|
||||
|
||||
public static final String SELECT = "Select";
|
||||
|
||||
public static final WorkspaceExplorerServiceAsync workspaceNavigatorService = GWT.create(WorkspaceExplorerService.class);
|
||||
}
|
||||
|
|
|
@ -18,8 +18,6 @@ import org.gcube.portlets.widgets.wsexplorer.client.event.LoadRootEventHandler;
|
|||
import org.gcube.portlets.widgets.wsexplorer.client.event.RootLoadedEvent;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.event.RootLoadedEventHandler;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.resources.WorkspaceExplorerResources;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.rpc.WorkspaceExplorerService;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.rpc.WorkspaceExplorerServiceAsync;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.view.Breadcrumbs;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.view.Navigation;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.view.WorkspaceExplorer;
|
||||
|
@ -54,8 +52,6 @@ public class WorkspaceExplorerController implements EventHandler {
|
|||
private WorkspaceExplorer wsExplorer;
|
||||
private Breadcrumbs breadcrumbs = new Breadcrumbs(eventBus);
|
||||
private Navigation navigation = new Navigation(eventBus);
|
||||
|
||||
public static final WorkspaceExplorerServiceAsync workspaceNavigatorService = GWT.create(WorkspaceExplorerService.class);
|
||||
|
||||
/**
|
||||
* Instantiates a new workspace explorer controller.
|
||||
|
@ -130,7 +126,7 @@ public class WorkspaceExplorerController implements EventHandler {
|
|||
public void onLoadRoot(LoadRootEvent loadRootEvent) {
|
||||
wsExplorer.loadRoot();
|
||||
|
||||
workspaceNavigatorService.getItemByCategory(ItemCategory.HOME, new AsyncCallback<Item>() {
|
||||
WorkspaceExplorerConstants.workspaceNavigatorService.getItemByCategory(ItemCategory.HOME, new AsyncCallback<Item>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
@ -168,7 +164,7 @@ public class WorkspaceExplorerController implements EventHandler {
|
|||
public void onLoadMySpecialFolder(LoadMySpecialFolderEvent loadMySpecialFolderEvent) {
|
||||
wsExplorer.loadMySpecialFolder();
|
||||
|
||||
workspaceNavigatorService.getItemByCategory(ItemCategory.VRE_FOLDER, new AsyncCallback<Item>() {
|
||||
WorkspaceExplorerConstants.workspaceNavigatorService.getItemByCategory(ItemCategory.VRE_FOLDER, new AsyncCallback<Item>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
@ -195,7 +191,7 @@ public class WorkspaceExplorerController implements EventHandler {
|
|||
|
||||
GWT.log("Reload Parent Breadcrumb: [Item id: "+itemIdentifier+"]");
|
||||
|
||||
workspaceNavigatorService.getBreadcrumbsByItemIdentifier(itemIdentifier, includeItemAsParent, new AsyncCallback<List<Item>>() {
|
||||
WorkspaceExplorerConstants.workspaceNavigatorService.getBreadcrumbsByItemIdentifier(itemIdentifier, includeItemAsParent, new AsyncCallback<List<Item>>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
@ -251,7 +247,7 @@ public class WorkspaceExplorerController implements EventHandler {
|
|||
if(!item.isFolder())
|
||||
hp.add(labelMime);
|
||||
hp.add(labelACL);
|
||||
workspaceNavigatorService.getReadableSizeByItemId(item.getId(), new AsyncCallback<String>() {
|
||||
WorkspaceExplorerConstants.workspaceNavigatorService.getReadableSizeByItemId(item.getId(), new AsyncCallback<String>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
@ -264,7 +260,7 @@ public class WorkspaceExplorerController implements EventHandler {
|
|||
});
|
||||
|
||||
if(!item.isFolder()){
|
||||
workspaceNavigatorService.getMimeType(item.getId(), new AsyncCallback<String>() {
|
||||
WorkspaceExplorerConstants.workspaceNavigatorService.getMimeType(item.getId(), new AsyncCallback<String>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
@ -278,7 +274,7 @@ public class WorkspaceExplorerController implements EventHandler {
|
|||
});
|
||||
}
|
||||
|
||||
workspaceNavigatorService.getUserACLForFolderId(item.getId(), new AsyncCallback<String>() {
|
||||
WorkspaceExplorerConstants.workspaceNavigatorService.getUserACLForFolderId(item.getId(), new AsyncCallback<String>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
|
|
@ -6,7 +6,7 @@ package org.gcube.portlets.widgets.wsexplorer.client.explore;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.WorkspaceExplorerController;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.WorkspaceExplorerConstants;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.event.BreadcrumbClickEvent;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.event.BreadcrumbClickEventHandler;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.event.ClickItemEvent;
|
||||
|
@ -56,7 +56,6 @@ public class WorkspaceResourcesExplorerPanel extends DockPanel implements HasWor
|
|||
private WorkspaceExplorer wsExplorer;
|
||||
private ScrollPanel centerScrollable = new ScrollPanel();
|
||||
private ScrollPanel southPanel = new ScrollPanel();
|
||||
|
||||
private String folderId;
|
||||
private String folderName;
|
||||
|
||||
|
@ -169,7 +168,7 @@ public class WorkspaceResourcesExplorerPanel extends DockPanel implements HasWor
|
|||
|
||||
GWT.log("Reload Parent Breadcrumb: [Item id: "+itemIdentifier+"]");
|
||||
|
||||
WorkspaceExplorerController.workspaceNavigatorService.getBreadcrumbsByItemIdentifierToParentLimit(itemIdentifier, folderId, includeItemAsParent, new AsyncCallback<List<Item>>() {
|
||||
WorkspaceExplorerConstants.workspaceNavigatorService.getBreadcrumbsByItemIdentifierToParentLimit(itemIdentifier, folderId, includeItemAsParent, new AsyncCallback<List<Item>>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
package org.gcube.portlets.widgets.wsexplorer.client.view;
|
||||
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.WorkspaceExplorerConstants;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.WorkspaceExplorerController;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.event.LoadMySpecialFolderEvent;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.event.LoadRootEvent;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.resources.WorkspaceExplorerResources;
|
||||
|
@ -59,7 +58,7 @@ public class Navigation extends Composite{
|
|||
getElement().getStyle().setMarginLeft(5.0, Unit.PX);
|
||||
home.setActive(true);
|
||||
|
||||
WorkspaceExplorerController.workspaceNavigatorService.getItemByCategory(ItemCategory.HOME, new AsyncCallback<Item>() {
|
||||
WorkspaceExplorerConstants.workspaceNavigatorService.getItemByCategory(ItemCategory.HOME, new AsyncCallback<Item>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(Item result) {
|
||||
|
@ -87,7 +86,7 @@ public class Navigation extends Composite{
|
|||
vre_folder.setActive(true);
|
||||
vre_folder.setBaseIcon(WorkspaceExplorerResources.CustomIconType.vre_folder);
|
||||
|
||||
WorkspaceExplorerController.workspaceNavigatorService.getItemByCategory(ItemCategory.VRE_FOLDER, new AsyncCallback<Item>() {
|
||||
WorkspaceExplorerConstants.workspaceNavigatorService.getItemByCategory(ItemCategory.VRE_FOLDER, new AsyncCallback<Item>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(Item result) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.Util;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.WorkspaceExplorerController;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.WorkspaceExplorerConstants;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.event.RootLoadedEvent;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.resources.WorkspaceExplorerResources;
|
||||
import org.gcube.portlets.widgets.wsexplorer.client.view.grid.ItemsTable;
|
||||
|
@ -131,7 +131,7 @@ public class WorkspaceExplorer implements ShowableTypes, SelectableTypes{
|
|||
|
||||
GWT.log("loading workspace tree from server");
|
||||
|
||||
WorkspaceExplorerController.workspaceNavigatorService.getRoot(showableTypesParam, purgeEmpyFolders, filterCriteria, new AsyncCallback<Item>() {
|
||||
WorkspaceExplorerConstants.workspaceNavigatorService.getRoot(showableTypesParam, purgeEmpyFolders, filterCriteria, new AsyncCallback<Item>() {
|
||||
|
||||
public void onFailure(Throwable caught) {
|
||||
Window.alert(caught.getMessage());
|
||||
|
@ -176,7 +176,7 @@ public class WorkspaceExplorer implements ShowableTypes, SelectableTypes{
|
|||
// FilterCriteria filterCriteria = new FilterCriteria(allowedMimeTypes,requiredProperties, allowedFileExtensions);
|
||||
|
||||
GWT.log("loading workspace folder by item id from server: "+item.getId());
|
||||
WorkspaceExplorerController.workspaceNavigatorService.getFolder(item.getId(), showableTypesParam, purgeEmpyFolders, filterCriteria, new AsyncCallback<Item>() {
|
||||
WorkspaceExplorerConstants.workspaceNavigatorService.getFolder(item.getId(), showableTypesParam, purgeEmpyFolders, filterCriteria, new AsyncCallback<Item>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
@ -216,7 +216,7 @@ public class WorkspaceExplorer implements ShowableTypes, SelectableTypes{
|
|||
// FilterCriteria filterCriteria = new FilterCriteria(allowedMimeTypes,requiredProperties, allowedFileExtensions);
|
||||
|
||||
GWT.log("loading workspace tree from server");
|
||||
WorkspaceExplorerController.workspaceNavigatorService.getMySpecialFolder(showableTypesParam, purgeEmpyFolders, filterCriteria, new AsyncCallback<Item>() {
|
||||
WorkspaceExplorerConstants.workspaceNavigatorService.getMySpecialFolder(showableTypesParam, purgeEmpyFolders, filterCriteria, new AsyncCallback<Item>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
|
Loading…
Reference in New Issue