From 5f9d1078f2758d2567022371aa3b54274b73e604 Mon Sep 17 00:00:00 2001 From: Francesco Mangiacrapa Date: Fri, 10 Jul 2015 13:25:42 +0000 Subject: [PATCH] 256: Workspace explorer Task-Url: https://support.d4science.org/issues/256 Updated styles and labels git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-explorer@117168 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../client/WorkspaceExplorerController.java | 2 +- .../client/rpc/WorkspaceExplorerService.java | 1 - .../client/rpc/WorkspaceExplorerServiceAsync.java | 1 - .../wsexplorer/client/view/grid/ItemsTable.java | 1 - .../widgets/wsexplorer/server/ItemBuilder.java | 14 ++++++++------ .../server/WorkspaceExplorerServiceImpl.java | 7 ++----- 6 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/gcube/portlets/widgets/wsexplorer/client/WorkspaceExplorerController.java b/src/main/java/org/gcube/portlets/widgets/wsexplorer/client/WorkspaceExplorerController.java index 90c4297..9870ae2 100644 --- a/src/main/java/org/gcube/portlets/widgets/wsexplorer/client/WorkspaceExplorerController.java +++ b/src/main/java/org/gcube/portlets/widgets/wsexplorer/client/WorkspaceExplorerController.java @@ -186,7 +186,7 @@ public class WorkspaceExplorerController implements EventHandler { final HorizontalPanel hp = new HorizontalPanel(); Image iconInfo = WorkspaceExplorerResources.getIconInfo().createImage(); iconInfo.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE); - hp.add(WorkspaceExplorerResources.getIconInfo().createImage()); + hp.add(iconInfo); final Label labelName = new Label("Name: "+item.getName()); double marginValue = 10.0; labelName.getElement().getStyle().setMarginLeft(marginValue, Unit.PX); diff --git a/src/main/java/org/gcube/portlets/widgets/wsexplorer/client/rpc/WorkspaceExplorerService.java b/src/main/java/org/gcube/portlets/widgets/wsexplorer/client/rpc/WorkspaceExplorerService.java index 4469c86..9a4f950 100644 --- a/src/main/java/org/gcube/portlets/widgets/wsexplorer/client/rpc/WorkspaceExplorerService.java +++ b/src/main/java/org/gcube/portlets/widgets/wsexplorer/client/rpc/WorkspaceExplorerService.java @@ -6,7 +6,6 @@ import org.gcube.portlets.widgets.wsexplorer.shared.FilterCriteria; import org.gcube.portlets.widgets.wsexplorer.shared.Item; import org.gcube.portlets.widgets.wsexplorer.shared.ItemCategory; import org.gcube.portlets.widgets.wsexplorer.shared.ItemType; -import org.gcube.portlets.widgets.wsexplorer.shared.SizeFormatter; import org.gcube.portlets.widgets.wsexplorer.shared.WorkspaceNavigatorServiceException; import com.google.gwt.user.client.rpc.RemoteService; diff --git a/src/main/java/org/gcube/portlets/widgets/wsexplorer/client/rpc/WorkspaceExplorerServiceAsync.java b/src/main/java/org/gcube/portlets/widgets/wsexplorer/client/rpc/WorkspaceExplorerServiceAsync.java index e252d46..9d800e4 100644 --- a/src/main/java/org/gcube/portlets/widgets/wsexplorer/client/rpc/WorkspaceExplorerServiceAsync.java +++ b/src/main/java/org/gcube/portlets/widgets/wsexplorer/client/rpc/WorkspaceExplorerServiceAsync.java @@ -9,7 +9,6 @@ import org.gcube.portlets.widgets.wsexplorer.shared.FilterCriteria; import org.gcube.portlets.widgets.wsexplorer.shared.Item; import org.gcube.portlets.widgets.wsexplorer.shared.ItemCategory; import org.gcube.portlets.widgets.wsexplorer.shared.ItemType; -import org.gcube.portlets.widgets.wsexplorer.shared.SizeFormatter; import com.google.gwt.user.client.rpc.AsyncCallback; diff --git a/src/main/java/org/gcube/portlets/widgets/wsexplorer/client/view/grid/ItemsTable.java b/src/main/java/org/gcube/portlets/widgets/wsexplorer/client/view/grid/ItemsTable.java index cf1e30a..1038e47 100644 --- a/src/main/java/org/gcube/portlets/widgets/wsexplorer/client/view/grid/ItemsTable.java +++ b/src/main/java/org/gcube/portlets/widgets/wsexplorer/client/view/grid/ItemsTable.java @@ -39,7 +39,6 @@ public class ItemsTable extends AbstractItemsCellTable { private TextColumn name; private TextColumn owner; private Item selectedItem = null; - private Column moreInfo; /** * Instantiates a new items table. diff --git a/src/main/java/org/gcube/portlets/widgets/wsexplorer/server/ItemBuilder.java b/src/main/java/org/gcube/portlets/widgets/wsexplorer/server/ItemBuilder.java index 6b3829f..0e48bc2 100644 --- a/src/main/java/org/gcube/portlets/widgets/wsexplorer/server/ItemBuilder.java +++ b/src/main/java/org/gcube/portlets/widgets/wsexplorer/server/ItemBuilder.java @@ -77,17 +77,18 @@ public class ItemBuilder { */ public static Item getItem(Item parent, WorkspaceItem workspaceItem, List showableTypes, FilterCriteria filterCriteria, boolean loadChildren) throws InternalErrorException { - - _log.info("Building item for: "+workspaceItem.getName()); + ItemType type = getItemType(workspaceItem); if (!showableTypes.contains(type)) return null; if (!filterItem(type, workspaceItem, filterCriteria)) return null; String itemName = workspaceItem.getName(); - if (workspaceItem.getName().equals(WorkspaceExplorerConstants.SPECIAL_FOLDERS_LABEL)) { + _log.info("Building Item for: "+itemName); + + //TODO ADD CONTROL ON THE PATH WHEN WILL BE MORE FAST + if (itemName.equals(WorkspaceExplorerConstants.SPECIAL_FOLDERS_LABEL)) itemName = "My VRE Folders"; - } boolean isFolder = false; if(type.equals(ItemType.FOLDER) || type.equals(ItemType.ROOT)) @@ -98,9 +99,10 @@ public class ItemBuilder { if(loadChildren){ for (WorkspaceItem child: workspaceItem.getChildren()){ - Item itemChild = getItem(item, child, showableTypes, filterCriteria, false); + _log.info("Converting child item: "+itemName); + Item itemChild = getItem(item, child, showableTypes, filterCriteria, false); + _log.info("Item: "+itemName +" converted!!!"); if (itemChild!=null){ - // item.removeChild(empty); item.addChild(itemChild); } } diff --git a/src/main/java/org/gcube/portlets/widgets/wsexplorer/server/WorkspaceExplorerServiceImpl.java b/src/main/java/org/gcube/portlets/widgets/wsexplorer/server/WorkspaceExplorerServiceImpl.java index 3a431d7..f143b24 100644 --- a/src/main/java/org/gcube/portlets/widgets/wsexplorer/server/WorkspaceExplorerServiceImpl.java +++ b/src/main/java/org/gcube/portlets/widgets/wsexplorer/server/WorkspaceExplorerServiceImpl.java @@ -1,7 +1,6 @@ package org.gcube.portlets.widgets.wsexplorer.server; import java.text.DecimalFormat; -import java.text.NumberFormat; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -27,7 +26,6 @@ import org.gcube.portlets.widgets.wsexplorer.shared.FilterCriteria; import org.gcube.portlets.widgets.wsexplorer.shared.Item; import org.gcube.portlets.widgets.wsexplorer.shared.ItemCategory; import org.gcube.portlets.widgets.wsexplorer.shared.ItemType; -import org.gcube.portlets.widgets.wsexplorer.shared.SizeFormatter; import org.gcube.portlets.widgets.wsexplorer.shared.WorkspaceNavigatorServiceException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -48,7 +46,7 @@ public class WorkspaceExplorerServiceImpl extends RemoteServiceServlet implement */ public static final Logger _log = LoggerFactory.getLogger(WorkspaceExplorerServiceImpl.class); public static final String USERNAME_ATTRIBUTE = "username"; - public static final String TEST_USER = "test.user"; + public static final String TEST_USER = "francesco.mangiacrapa"; /** @@ -229,7 +227,6 @@ public class WorkspaceExplorerServiceImpl extends RemoteServiceServlet implement long startTime = System.currentTimeMillis(); _log.trace("start time - " + startTime); - Item itemFolder = ItemBuilder.getItem(null, folder, showableTypes, filterCriteria, true); itemFolder.setName(WorkspaceExplorerConstants.VRE_FOLDERS_LABEL); itemFolder.setSpecialFolder(true); @@ -477,6 +474,6 @@ public class WorkspaceExplorerServiceImpl extends RemoteServiceServlet implement if(size == 0) return "Empty"; final String[] units = new String[] { "B", "KB", "MB", "GB", "TB" }; int digitGroups = (int) (Math.log10(size)/Math.log10(1024)); - return new DecimalFormat("#,##0.#").format(size/Math.pow(1024, digitGroups)) + " " + units[digitGroups]; + return new DecimalFormat("#,##0.#").format(size/Math.pow(1024, digitGroups))+units[digitGroups]; } }