Class WorkspaceUtils
- java.lang.Object
-
- org.gcube.portlets.widgets.ckandatapublisherwidget.server.utils.WorkspaceUtils
-
public class WorkspaceUtils extends Object
The Class WorkspaceUtils.- Author:
- Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it) Feb 18, 2021
-
-
Constructor Summary
Constructors Constructor Description WorkspaceUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Map<String,String>getGcubeItemProperties(org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceItem item)Gets the gcube item properties.static org.gcube.common.storagehubwrapper.server.StorageHubWrappergetStorageHubWrapper(javax.servlet.http.HttpServletRequest request, String scopeGroupId, org.gcube.vomanagement.usermanagement.model.GCubeUser user)Gets the storage hub wrapper.static booleanisWithinPortal()Checks if is within portal.static List<org.gcube.datacatalogue.utillibrary.shared.ResourceBean>toResources(DatasetBean bean, org.gcube.common.storagehubwrapper.server.tohl.Workspace workspace, String username)Copy into the .catalogue area folder the checked resources.static Map<String,String>toSimpleMap(org.gcube.common.storagehubwrapper.shared.tohl.items.PropertyMap propertyMap)To simple map.static voidtoWorkspaceResource(String wsItemId, String userName, DatasetBean bean, org.gcube.common.storagehubwrapper.server.tohl.Workspace workspace)This method receives an item-id within the user's workspace and setit in the dataset bean to be returned.
-
-
-
Method Detail
-
isWithinPortal
public static boolean isWithinPortal()
Checks if is within portal.- Returns:
- true if you're running into the portal, false if in development
-
getStorageHubWrapper
public static org.gcube.common.storagehubwrapper.server.StorageHubWrapper getStorageHubWrapper(javax.servlet.http.HttpServletRequest request, String scopeGroupId, org.gcube.vomanagement.usermanagement.model.GCubeUser user) throws ExceptionGets the storage hub wrapper.- Parameters:
request- the requestscopeGroupId- the scope group id. If scopeGroupId is null the scope is read by using the request else by using the scopeGroupIduser- the user- Returns:
- the storage hub wrapper
- Throws:
Exception- the exception
-
toWorkspaceResource
public static void toWorkspaceResource(String wsItemId, String userName, DatasetBean bean, org.gcube.common.storagehubwrapper.server.tohl.Workspace workspace) throws Exception
This method receives an item-id within the user's workspace and setit in the dataset bean to be returned. revisited by Francesco- Parameters:
wsItemId- the ws item iduserName- the user namebean- the beanworkspace- the workspace- Throws:
Exception- the exception
-
getGcubeItemProperties
public static Map<String,String> getGcubeItemProperties(org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceItem item)
Gets the gcube item properties.- Parameters:
item- the item- Returns:
- the gcube item properties
-
toSimpleMap
public static Map<String,String> toSimpleMap(org.gcube.common.storagehubwrapper.shared.tohl.items.PropertyMap propertyMap)
To simple map.- Parameters:
propertyMap- the property map- Returns:
- the map
-
toResources
public static List<org.gcube.datacatalogue.utillibrary.shared.ResourceBean> toResources(DatasetBean bean, org.gcube.common.storagehubwrapper.server.tohl.Workspace workspace, String username) throws Exception
Copy into the .catalogue area folder the checked resources. There is no difference among a single-file-publish and a folder-publish.- Parameters:
bean- the beanworkspace- the workspaceusername- the username- Returns:
- the list
- Throws:
Exception- the exception
-
-