added implementaton for getting properties
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-explorer@169396 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
8722c1c836
commit
e3da069d02
2
pom.xml
2
pom.xml
|
@ -56,7 +56,7 @@
|
|||
<dependency>
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>storagehub-client-library</artifactId>
|
||||
<scope>compile</scope>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.portal</groupId>
|
||||
|
|
|
@ -5,6 +5,7 @@ package org.gcube.portlets.widgets.wsexplorer.server;
|
|||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -12,6 +13,7 @@ import java.util.Map.Entry;
|
|||
|
||||
import org.gcube.common.storagehub.client.plugins.AbstractPlugin;
|
||||
import org.gcube.common.storagehub.client.proxies.ItemManagerClient;
|
||||
import org.gcube.common.storagehub.model.Metadata;
|
||||
import org.gcube.common.storagehub.model.items.AbstractFileItem;
|
||||
import org.gcube.common.storagehub.model.items.ExternalURL;
|
||||
import org.gcube.common.storagehub.model.items.FolderItem;
|
||||
|
@ -436,15 +438,19 @@ public class ItemBuilder {
|
|||
* @throws InternalErrorException the internal error exception
|
||||
*/
|
||||
protected static Map<String,String> getGcubePropertiesForItem(Item item) {
|
||||
return null;
|
||||
//TODO: see how to return this later
|
||||
// try {
|
||||
// return item.getProperties().getProperties();
|
||||
// }
|
||||
// catch (InternalErrorException e) {
|
||||
// logger.warn("An error occurred during get properties for item: "+item.getId()+", returning null");
|
||||
// return null;
|
||||
// }
|
||||
Map<String, String> itemMap = new HashMap<String, String>();
|
||||
try {
|
||||
Metadata metadata = item.getPropertyMap();
|
||||
Map<String, Object> metadataMap = metadata.getValues();
|
||||
for (String key : metadataMap.keySet()) {
|
||||
String s = String.valueOf(metadataMap.get(key));
|
||||
itemMap.put(key, s);
|
||||
}
|
||||
return itemMap;
|
||||
}catch (Exception e) {
|
||||
_log.warn("An error occurred during get properties for item: "+item.getId()+", returning null");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue