This commit is contained in:
Lucio Lelii 2018-06-19 09:11:53 +00:00
parent 0a37d04c9e
commit 18b871244d
9 changed files with 31 additions and 14 deletions

View File

@ -0,0 +1,12 @@
package org.gcube.common.storagehub.model;
public class NodeConstants {
public static final String ACCOUNTING_NAME ="hl:accounting";
public static final String METADATA_NAME ="hl:metadata";
public static final String OWNER_NAME ="hl:owner";
public static final String CONTENT_NAME ="jcr:content";
public static final String USERS_NAME ="hl:users";
public static final String PROPERTY_NAME ="hl:property";
}

View File

@ -1,5 +1,6 @@
package org.gcube.common.storagehub.model.items;
import org.gcube.common.storagehub.model.NodeConstants;
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;
@ -16,6 +17,6 @@ import lombok.Setter;
@RootNode("nthl:externalUrl")
public class ExternalURL extends AbstractFileItem{
@NodeAttribute(value ="jcr:content")
@NodeAttribute(value =NodeConstants.CONTENT_NAME)
Content content;
}

View File

@ -5,6 +5,7 @@ import lombok.NoArgsConstructor;
import lombok.Setter;
import org.gcube.common.storagehub.model.Metadata;
import org.gcube.common.storagehub.model.NodeConstants;
import org.gcube.common.storagehub.model.annotations.Attribute;
import org.gcube.common.storagehub.model.annotations.NodeAttribute;
import org.gcube.common.storagehub.model.annotations.RootNode;
@ -30,7 +31,7 @@ public class GCubeItem extends Item{
@Attribute("hl:isShared")
boolean shared;
@NodeAttribute("hl:property")
@NodeAttribute(NodeConstants.PROPERTY_NAME)
Metadata property;
}

View File

@ -1,5 +1,6 @@
package org.gcube.common.storagehub.model.items;
import org.gcube.common.storagehub.model.NodeConstants;
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;
@ -18,7 +19,7 @@ public class GenericFileItem extends AbstractFileItem{
@NodeAttribute(value ="jcr:content")
@NodeAttribute(value =NodeConstants.CONTENT_NAME)
Content content;
}

View File

@ -1,5 +1,6 @@
package org.gcube.common.storagehub.model.items;
import org.gcube.common.storagehub.model.NodeConstants;
import org.gcube.common.storagehub.model.annotations.NodeAttribute;
import org.gcube.common.storagehub.model.annotations.RootNode;
import org.gcube.common.storagehub.model.items.nodes.ImageContent;
@ -17,7 +18,7 @@ import lombok.Setter;
@RootNode("nthl:externalImage")
public class ImageFile extends AbstractFileItem{
@NodeAttribute(value="jcr:content")
@NodeAttribute(value=NodeConstants.CONTENT_NAME)
ImageContent content;

View File

@ -1,7 +1,7 @@
package org.gcube.common.storagehub.model.items;
import java.util.Calendar;
import static org.gcube.common.storagehub.model.NodeConstants.*;
import org.gcube.common.storagehub.model.Metadata;
import org.gcube.common.storagehub.model.annotations.Attribute;
import org.gcube.common.storagehub.model.annotations.NodeAttribute;
@ -62,17 +62,15 @@ public class Item {
@Attribute("hl:hidden")
boolean hidden;
@NodeAttribute(value="hl:owner", isReadOnly=true)
@NodeAttribute(value=OWNER_NAME, isReadOnly=true)
Owner ownerNode;
@NodeAttribute(value="hl:accounting", isReadOnly=true)
@NodeAttribute(value=ACCOUNTING_NAME, isReadOnly=true)
Accounting accounting;
@NodeAttribute(value="hl:metadata", isReadOnly=true)
@NodeAttribute(value=METADATA_NAME, isReadOnly=true)
Metadata propertyMap;
//List <AccountingDelegate> accounting;
public String getOwner() {
if (owner!=null) return owner;
else return ownerNode.getUserName();

View File

@ -1,5 +1,6 @@
package org.gcube.common.storagehub.model.items;
import org.gcube.common.storagehub.model.NodeConstants;
import org.gcube.common.storagehub.model.annotations.NodeAttribute;
import org.gcube.common.storagehub.model.annotations.RootNode;
import org.gcube.common.storagehub.model.items.nodes.PDFContent;
@ -16,7 +17,7 @@ import lombok.Setter;
@RootNode("nthl:externalPdf")
public class PDFFileItem extends AbstractFileItem {
@NodeAttribute(value="jcr:content")
@NodeAttribute(value=NodeConstants.CONTENT_NAME)
PDFContent content;
}

View File

@ -5,6 +5,7 @@ import lombok.NoArgsConstructor;
import lombok.Setter;
import org.gcube.common.storagehub.model.Metadata;
import org.gcube.common.storagehub.model.NodeConstants;
import org.gcube.common.storagehub.model.annotations.Attribute;
import org.gcube.common.storagehub.model.annotations.NodeAttribute;
import org.gcube.common.storagehub.model.annotations.RootNode;
@ -24,7 +25,7 @@ public class SharedFolder extends FolderItem {
@Attribute("hl:displayName")
String displayName;
@NodeAttribute("hl:users")
@NodeAttribute(NodeConstants.USERS_NAME)
Metadata users;
/* @NodeAttribute("hl:members")

View File

@ -4,6 +4,7 @@ import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.gcube.common.storagehub.model.NodeConstants;
import org.gcube.common.storagehub.model.annotations.NodeAttribute;
import org.gcube.common.storagehub.model.annotations.RootNode;
import org.gcube.common.storagehub.model.items.nodes.SmartFolderContent;
@ -14,6 +15,6 @@ import org.gcube.common.storagehub.model.items.nodes.SmartFolderContent;
@RootNode("nthl:workspaceSmartItem")
public class SmartFolder {
@NodeAttribute("jcr:content")
@NodeAttribute(NodeConstants.CONTENT_NAME)
SmartFolderContent content;
}