2018-02-15 18:14:30 +01:00
|
|
|
package org.gcube.common.storagehub.model.items;
|
|
|
|
|
2021-04-14 15:43:09 +02:00
|
|
|
import static org.gcube.common.storagehub.model.NodeConstants.ACCOUNTING_NAME;
|
2021-10-15 13:14:45 +02:00
|
|
|
import static org.gcube.common.storagehub.model.NodeConstants.CREATEDTIME;
|
|
|
|
import static org.gcube.common.storagehub.model.NodeConstants.DESCRIPTION;
|
|
|
|
import static org.gcube.common.storagehub.model.NodeConstants.HIDDEN;
|
|
|
|
import static org.gcube.common.storagehub.model.NodeConstants.LASTACTION;
|
|
|
|
import static org.gcube.common.storagehub.model.NodeConstants.LASTMODIFIEDBY;
|
|
|
|
import static org.gcube.common.storagehub.model.NodeConstants.LASTMODIFIEDTIME;
|
2021-04-14 15:43:09 +02:00
|
|
|
import static org.gcube.common.storagehub.model.NodeConstants.METADATA_NAME;
|
|
|
|
import static org.gcube.common.storagehub.model.NodeConstants.OWNER_NAME;
|
2021-10-15 13:14:45 +02:00
|
|
|
import static org.gcube.common.storagehub.model.NodeConstants.PORTALLOGIN;
|
|
|
|
import static org.gcube.common.storagehub.model.NodeConstants.PUBLIC;
|
|
|
|
import static org.gcube.common.storagehub.model.NodeConstants.TITLE;
|
2021-04-14 15:43:09 +02:00
|
|
|
|
2018-02-15 18:14:30 +01:00
|
|
|
import java.util.Calendar;
|
2021-04-14 15:43:09 +02:00
|
|
|
|
2018-05-18 17:07:36 +02:00
|
|
|
import org.gcube.common.storagehub.model.Metadata;
|
2018-02-15 18:14:30 +01:00
|
|
|
import org.gcube.common.storagehub.model.annotations.Attribute;
|
|
|
|
import org.gcube.common.storagehub.model.annotations.NodeAttribute;
|
|
|
|
import org.gcube.common.storagehub.model.items.nodes.Accounting;
|
2018-06-05 12:50:23 +02:00
|
|
|
import org.gcube.common.storagehub.model.items.nodes.Owner;
|
2018-02-15 18:14:30 +01:00
|
|
|
import org.gcube.common.storagehub.model.types.ItemAction;
|
|
|
|
|
2021-04-16 10:07:04 +02:00
|
|
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
|
|
|
|
2018-03-07 18:42:21 +01:00
|
|
|
import lombok.Getter;
|
|
|
|
import lombok.NoArgsConstructor;
|
|
|
|
import lombok.Setter;
|
|
|
|
|
2018-02-15 18:14:30 +01:00
|
|
|
@Getter
|
|
|
|
@Setter
|
|
|
|
@NoArgsConstructor
|
2021-04-16 10:07:04 +02:00
|
|
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
2021-04-14 15:43:09 +02:00
|
|
|
public class Item extends RootItem{
|
2018-03-07 18:42:21 +01:00
|
|
|
|
|
|
|
boolean trashed;
|
|
|
|
|
2021-09-28 12:50:01 +02:00
|
|
|
boolean externalManaged = false;
|
2021-04-14 15:43:09 +02:00
|
|
|
|
2018-03-07 18:42:21 +01:00
|
|
|
boolean shared;
|
2018-02-15 18:14:30 +01:00
|
|
|
|
|
|
|
boolean locked;
|
|
|
|
|
2021-10-15 13:14:45 +02:00
|
|
|
@Attribute(PUBLIC)
|
2018-10-23 10:21:48 +02:00
|
|
|
boolean publicItem;
|
|
|
|
|
2021-10-15 13:14:45 +02:00
|
|
|
@Attribute(TITLE)
|
2018-02-15 18:14:30 +01:00
|
|
|
String title;
|
|
|
|
|
2021-10-15 13:14:45 +02:00
|
|
|
@Attribute(DESCRIPTION)
|
2018-02-15 18:14:30 +01:00
|
|
|
String description;
|
|
|
|
|
2021-10-15 13:14:45 +02:00
|
|
|
@Attribute(LASTMODIFIEDBY)
|
2018-02-15 18:14:30 +01:00
|
|
|
String lastModifiedBy;
|
|
|
|
|
2021-10-15 13:14:45 +02:00
|
|
|
@Attribute(LASTMODIFIEDTIME)
|
2018-02-15 18:14:30 +01:00
|
|
|
Calendar lastModificationTime;
|
|
|
|
|
2021-10-15 13:14:45 +02:00
|
|
|
@Attribute(value = CREATEDTIME, isReadOnly=true)
|
2018-02-15 18:14:30 +01:00
|
|
|
Calendar creationTime;
|
|
|
|
|
2021-10-15 13:14:45 +02:00
|
|
|
@Attribute(PORTALLOGIN)
|
2018-02-15 18:14:30 +01:00
|
|
|
String owner;
|
|
|
|
|
2021-10-15 13:14:45 +02:00
|
|
|
@Attribute(LASTACTION)
|
2018-02-15 18:14:30 +01:00
|
|
|
ItemAction lastAction;
|
2018-03-07 18:42:21 +01:00
|
|
|
|
2021-10-15 13:14:45 +02:00
|
|
|
@Attribute(HIDDEN)
|
2018-02-15 18:14:30 +01:00
|
|
|
boolean hidden;
|
|
|
|
|
2018-06-19 11:11:53 +02:00
|
|
|
@NodeAttribute(value=OWNER_NAME, isReadOnly=true)
|
2018-06-05 12:50:23 +02:00
|
|
|
Owner ownerNode;
|
|
|
|
|
2018-06-19 11:11:53 +02:00
|
|
|
@NodeAttribute(value=ACCOUNTING_NAME, isReadOnly=true)
|
2018-02-15 18:14:30 +01:00
|
|
|
Accounting accounting;
|
|
|
|
|
2018-10-15 19:44:56 +02:00
|
|
|
@NodeAttribute(value=METADATA_NAME)
|
2018-11-28 16:36:53 +01:00
|
|
|
Metadata metadata = new Metadata();
|
2018-06-19 11:11:53 +02:00
|
|
|
|
2018-06-05 12:50:23 +02:00
|
|
|
public String getOwner() {
|
|
|
|
if (owner!=null) return owner;
|
2018-11-20 14:10:45 +01:00
|
|
|
else if (ownerNode!=null) return ownerNode.getUserName();
|
2018-10-15 19:44:56 +02:00
|
|
|
return null;
|
2018-06-05 12:50:23 +02:00
|
|
|
}
|
|
|
|
|
2018-02-15 18:14:30 +01:00
|
|
|
}
|