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>
|
<dependency>
|
||||||
<groupId>org.gcube.common</groupId>
|
<groupId>org.gcube.common</groupId>
|
||||||
<artifactId>storagehub-client-library</artifactId>
|
<artifactId>storagehub-client-library</artifactId>
|
||||||
<scope>compile</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.portal</groupId>
|
<groupId>org.gcube.portal</groupId>
|
||||||
|
|
|
@ -5,6 +5,7 @@ package org.gcube.portlets.widgets.wsexplorer.server;
|
||||||
|
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
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.plugins.AbstractPlugin;
|
||||||
import org.gcube.common.storagehub.client.proxies.ItemManagerClient;
|
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.AbstractFileItem;
|
||||||
import org.gcube.common.storagehub.model.items.ExternalURL;
|
import org.gcube.common.storagehub.model.items.ExternalURL;
|
||||||
import org.gcube.common.storagehub.model.items.FolderItem;
|
import org.gcube.common.storagehub.model.items.FolderItem;
|
||||||
|
@ -436,15 +438,19 @@ public class ItemBuilder {
|
||||||
* @throws InternalErrorException the internal error exception
|
* @throws InternalErrorException the internal error exception
|
||||||
*/
|
*/
|
||||||
protected static Map<String,String> getGcubePropertiesForItem(Item item) {
|
protected static Map<String,String> getGcubePropertiesForItem(Item item) {
|
||||||
return null;
|
Map<String, String> itemMap = new HashMap<String, String>();
|
||||||
//TODO: see how to return this later
|
try {
|
||||||
// try {
|
Metadata metadata = item.getPropertyMap();
|
||||||
// return item.getProperties().getProperties();
|
Map<String, Object> metadataMap = metadata.getValues();
|
||||||
// }
|
for (String key : metadataMap.keySet()) {
|
||||||
// catch (InternalErrorException e) {
|
String s = String.valueOf(metadataMap.get(key));
|
||||||
// logger.warn("An error occurred during get properties for item: "+item.getId()+", returning null");
|
itemMap.put(key, s);
|
||||||
// return null;
|
}
|
||||||
// }
|
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