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;
|
|
|
|
import static org.gcube.common.storagehub.model.NodeConstants.METADATA_NAME;
|
|
|
|
import static org.gcube.common.storagehub.model.NodeConstants.OWNER_NAME;
|
|
|
|
|
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;
|
|
|
|
|
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-14 15:43:09 +02:00
|
|
|
public class Item extends RootItem{
|
2018-03-07 18:42:21 +01:00
|
|
|
|
|
|
|
boolean trashed;
|
|
|
|
|
2021-04-14 15:43:09 +02:00
|
|
|
boolean externalManaged;
|
|
|
|
|
2018-03-07 18:42:21 +01:00
|
|
|
boolean shared;
|
2018-02-15 18:14:30 +01:00
|
|
|
|
|
|
|
boolean locked;
|
|
|
|
|
2018-10-23 10:21:48 +02:00
|
|
|
@Attribute("hl:isPublic")
|
|
|
|
boolean publicItem;
|
|
|
|
|
2018-10-15 15:39:29 +02:00
|
|
|
@Attribute(value ="jcr:title")
|
2018-02-15 18:14:30 +01:00
|
|
|
String title;
|
|
|
|
|
|
|
|
@Attribute("jcr:description")
|
|
|
|
String description;
|
|
|
|
|
|
|
|
@Attribute("jcr:lastModifiedBy")
|
|
|
|
String lastModifiedBy;
|
|
|
|
|
|
|
|
@Attribute("jcr:lastModified")
|
|
|
|
Calendar lastModificationTime;
|
|
|
|
|
2018-05-23 18:26:00 +02:00
|
|
|
@Attribute(value = "jcr:created", isReadOnly=true)
|
2018-02-15 18:14:30 +01:00
|
|
|
Calendar creationTime;
|
|
|
|
|
|
|
|
@Attribute("hl:portalLogin")
|
|
|
|
String owner;
|
|
|
|
|
|
|
|
@Attribute("hl:lastAction")
|
|
|
|
ItemAction lastAction;
|
2018-03-07 18:42:21 +01:00
|
|
|
|
2018-02-15 18:14:30 +01:00
|
|
|
@Attribute("hl:hidden")
|
|
|
|
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
|
|
|
}
|