From 50b0eb2164a515c4dc0f59a0401c18aa39cc76ba Mon Sep 17 00:00:00 2001 From: Lucio Lelii Date: Wed, 23 May 2018 13:31:42 +0000 Subject: [PATCH] git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/Common/storagehub-model@167699 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../storagehub/model/acls/AccessType.java | 19 +++++++++++++++++ .../storagehub/model/items/ExternalURL.java | 21 +++++++++++++++++++ .../model/items/GenericFileItem.java | 11 ++++------ .../storagehub/model/items/nodes/Content.java | 5 +++++ 4 files changed, 49 insertions(+), 7 deletions(-) create mode 100644 src/main/java/org/gcube/common/storagehub/model/acls/AccessType.java create mode 100644 src/main/java/org/gcube/common/storagehub/model/items/ExternalURL.java diff --git a/src/main/java/org/gcube/common/storagehub/model/acls/AccessType.java b/src/main/java/org/gcube/common/storagehub/model/acls/AccessType.java new file mode 100644 index 0000000..88b3f2f --- /dev/null +++ b/src/main/java/org/gcube/common/storagehub/model/acls/AccessType.java @@ -0,0 +1,19 @@ +package org.gcube.common.storagehub.model.acls; + +public enum AccessType { + + WRITE_ALL("hl:writeAll"), + ADMINISTRATOR("jcr:all"), + READ_ONLY("jcr:read"), + WRITE_OWNER("jcr:write"); + + private String value; + + private AccessType(String value){ + this.value = value; + } + + public String getValue() { + return value; + } +} diff --git a/src/main/java/org/gcube/common/storagehub/model/items/ExternalURL.java b/src/main/java/org/gcube/common/storagehub/model/items/ExternalURL.java new file mode 100644 index 0000000..acc5756 --- /dev/null +++ b/src/main/java/org/gcube/common/storagehub/model/items/ExternalURL.java @@ -0,0 +1,21 @@ +package org.gcube.common.storagehub.model.items; + +import org.gcube.common.storagehub.model.annotations.NodeAttribute; +import org.gcube.common.storagehub.model.annotations.RootNode; +import org.gcube.common.storagehub.model.items.nodes.Content; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@NoArgsConstructor +@AllArgsConstructor +@Getter +@Setter +@RootNode("nthl:externalUrl") +public class ExternalURL extends AbstractFileItem{ + + @NodeAttribute(value ="jcr:content") + Content content; +} diff --git a/src/main/java/org/gcube/common/storagehub/model/items/GenericFileItem.java b/src/main/java/org/gcube/common/storagehub/model/items/GenericFileItem.java index 20c81f6..de7bf11 100644 --- a/src/main/java/org/gcube/common/storagehub/model/items/GenericFileItem.java +++ b/src/main/java/org/gcube/common/storagehub/model/items/GenericFileItem.java @@ -1,17 +1,14 @@ package org.gcube.common.storagehub.model.items; +import org.gcube.common.storagehub.model.annotations.NodeAttribute; +import org.gcube.common.storagehub.model.annotations.RootNode; +import org.gcube.common.storagehub.model.items.nodes.Content; + import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; -import java.util.Collections; -import java.util.List; - -import org.gcube.common.storagehub.model.annotations.NodeAttribute; -import org.gcube.common.storagehub.model.annotations.RootNode; -import org.gcube.common.storagehub.model.items.nodes.Content; - @NoArgsConstructor @AllArgsConstructor @Getter diff --git a/src/main/java/org/gcube/common/storagehub/model/items/nodes/Content.java b/src/main/java/org/gcube/common/storagehub/model/items/nodes/Content.java index 3d03c48..7351bc7 100644 --- a/src/main/java/org/gcube/common/storagehub/model/items/nodes/Content.java +++ b/src/main/java/org/gcube/common/storagehub/model/items/nodes/Content.java @@ -4,8 +4,12 @@ import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; +import java.util.HashMap; +import java.util.Map; + import org.gcube.common.storagehub.model.annotations.Attribute; import org.gcube.common.storagehub.model.annotations.AttributeRootNode; +import org.gcube.common.storagehub.model.annotations.MapAttribute; @Getter @Setter @@ -28,4 +32,5 @@ public class Content { @Attribute("hl:storageId") String storageId; + }