only optimized the code
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@179907 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
c9dc926471
commit
09e80a460c
|
@ -3721,36 +3721,21 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.gcube.portlets.user.workspace.client.rpc.GWTWorkspaceService#
|
||||
* getItemForFileGrid(java.lang.String)
|
||||
*/
|
||||
/**
|
||||
* Gets the item for file grid.
|
||||
*
|
||||
* @param itemId
|
||||
* the item id
|
||||
* @return the item for file grid
|
||||
* @throws Exception
|
||||
* the exception
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.gcube.portlets.user.workspace.client.rpc.GWTWorkspaceService#getItemForFileGrid(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public FileGridModel getItemForFileGrid(String itemId) throws Exception {
|
||||
|
||||
try {
|
||||
|
||||
//TOOD MOVE TO SHUB
|
||||
|
||||
if (itemId == null)
|
||||
throw new Exception(IDENTIFIER_IS_NULL);
|
||||
|
||||
org.gcube.common.storagehubwrapper.server.tohl.Workspace workspace = null;
|
||||
org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceItem wsItem = null;
|
||||
workspace = getWorkspaceFromStorageHub();
|
||||
wsItem = workspace.getItem(itemId);
|
||||
|
||||
org.gcube.common.storagehubwrapper.server.tohl.Workspace workspace = getWorkspaceFromStorageHub();
|
||||
org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceItem wsItem = workspace.getItem(itemId);
|
||||
|
||||
StorageHubToWorkpaceConverter converter = getStorageHubToWorkpaceConverter();
|
||||
FileModel parentModel = null;
|
||||
if(wsItem.getParentId()!=null) {
|
||||
|
@ -3760,17 +3745,6 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
|||
|
||||
return converter.toGridFileModel(wsItem, parentModel);
|
||||
|
||||
/*GWTWorkspaceBuilder builder = getGWTWorkspaceBuilder();
|
||||
Long startTime = System.currentTimeMillis();
|
||||
Long endTime = System.currentTimeMillis() - startTime;
|
||||
String time = String.format("%d msc %d sec", endTime, TimeUnit.MILLISECONDS.toSeconds(endTime));
|
||||
workspaceLogger.debug("get child for Grid by id returning element in " + time);
|
||||
// BUILD PARENT
|
||||
WorkspaceFolder folder = wsItem.getParent(); // get parent
|
||||
FileGridModel wsFolder = builder.buildGXTFileGridModelItem(folder, null);
|
||||
// BUILD ITEM
|
||||
return builder.buildGXTFileGridModelItem(wsItem, wsFolder);*/
|
||||
|
||||
} catch (Exception e) {
|
||||
workspaceLogger.error("Error in server during item retrieving, getItemForFileGrid", e);
|
||||
String error = ConstantsExplorer.SERVER_ERROR + RETRIEVING_ITEM_EITHER_ITEM_DOESN_T_EXIST;
|
||||
|
|
Loading…
Reference in New Issue