From 97253ba328af2b1bbaad9e799094f9149eb672c7 Mon Sep 17 00:00:00 2001 From: Lucio Lelii Date: Mon, 15 Oct 2018 17:44:56 +0000 Subject: [PATCH] git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/Common/storagehub-model@173500 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../java/org/gcube/common/storagehub/model/Metadata.java | 4 ++-- .../common/storagehub/model/annotations/Attribute.java | 2 +- .../org/gcube/common/storagehub/model/items/GCubeItem.java | 2 +- .../java/org/gcube/common/storagehub/model/items/Item.java | 7 ++++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/gcube/common/storagehub/model/Metadata.java b/src/main/java/org/gcube/common/storagehub/model/Metadata.java index ab6d970..a011186 100644 --- a/src/main/java/org/gcube/common/storagehub/model/Metadata.java +++ b/src/main/java/org/gcube/common/storagehub/model/Metadata.java @@ -3,13 +3,13 @@ package org.gcube.common.storagehub.model; import java.util.HashMap; import java.util.Map; +import org.gcube.common.storagehub.model.annotations.MapAttribute; + import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; -import org.gcube.common.storagehub.model.annotations.MapAttribute; - @Getter @Setter @NoArgsConstructor diff --git a/src/main/java/org/gcube/common/storagehub/model/annotations/Attribute.java b/src/main/java/org/gcube/common/storagehub/model/annotations/Attribute.java index 4f3717b..82bc849 100644 --- a/src/main/java/org/gcube/common/storagehub/model/annotations/Attribute.java +++ b/src/main/java/org/gcube/common/storagehub/model/annotations/Attribute.java @@ -10,5 +10,5 @@ import java.lang.annotation.Target; public @interface Attribute { String value(); - boolean isReadOnly() default true; + boolean isReadOnly() default false; } diff --git a/src/main/java/org/gcube/common/storagehub/model/items/GCubeItem.java b/src/main/java/org/gcube/common/storagehub/model/items/GCubeItem.java index 8026d34..c098acb 100644 --- a/src/main/java/org/gcube/common/storagehub/model/items/GCubeItem.java +++ b/src/main/java/org/gcube/common/storagehub/model/items/GCubeItem.java @@ -32,6 +32,6 @@ public class GCubeItem extends Item{ boolean shared; @NodeAttribute(NodeConstants.PROPERTY_NAME) - Metadata property; + Metadata property = new Metadata(); } diff --git a/src/main/java/org/gcube/common/storagehub/model/items/Item.java b/src/main/java/org/gcube/common/storagehub/model/items/Item.java index fcaab13..862b88b 100644 --- a/src/main/java/org/gcube/common/storagehub/model/items/Item.java +++ b/src/main/java/org/gcube/common/storagehub/model/items/Item.java @@ -68,12 +68,13 @@ public class Item { @NodeAttribute(value=ACCOUNTING_NAME, isReadOnly=true) Accounting accounting; - @NodeAttribute(value=METADATA_NAME, isReadOnly=false) - Metadata propertyMap; + @NodeAttribute(value=METADATA_NAME) + Metadata propertyMap = new Metadata(); public String getOwner() { if (owner!=null) return owner; - else return ownerNode.getUserName(); + else if (ownerNode!=null) ownerNode.getUserName(); + return null; } }