2020-06-30 15:59:06 +02:00
|
|
|
package eu.eudat.models.data.dashboard.recent.model;
|
|
|
|
|
2020-07-03 12:55:25 +02:00
|
|
|
import eu.eudat.models.DataModel;
|
2020-07-24 09:50:16 +02:00
|
|
|
import eu.eudat.models.data.datasetprofile.DatasetProfileOverviewModel;
|
2020-07-03 09:43:54 +02:00
|
|
|
import eu.eudat.models.data.listingmodels.UserInfoListingModel;
|
2020-07-03 12:55:25 +02:00
|
|
|
import eu.eudat.queryable.queryableentity.DataEntity;
|
2020-07-03 09:43:54 +02:00
|
|
|
|
2020-06-30 15:59:06 +02:00
|
|
|
import java.util.Date;
|
2020-07-03 09:43:54 +02:00
|
|
|
import java.util.List;
|
2020-06-30 15:59:06 +02:00
|
|
|
|
2020-07-03 12:55:25 +02:00
|
|
|
public abstract class RecentActivityModel<T extends DataEntity, S extends DataModel> implements DataModel<T, S> {
|
2020-06-30 15:59:06 +02:00
|
|
|
private String id;
|
|
|
|
private String title;
|
|
|
|
private Date created;
|
|
|
|
private Date modified;
|
|
|
|
private int status;
|
|
|
|
private int version;
|
|
|
|
private String grant;
|
|
|
|
private Date finalizedAt;
|
|
|
|
private Date publishedAt;
|
2020-07-03 10:23:13 +02:00
|
|
|
private int type;
|
2020-07-03 09:43:54 +02:00
|
|
|
private List<UserInfoListingModel> users;
|
|
|
|
private Boolean isPublic;
|
2020-06-30 15:59:06 +02:00
|
|
|
|
|
|
|
public String getId() {
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setId(String id) {
|
|
|
|
this.id = id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getTitle() {
|
|
|
|
return title;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setTitle(String title) {
|
|
|
|
this.title = title;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Date getCreated() {
|
|
|
|
return created;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setCreated(Date created) {
|
|
|
|
this.created = created;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Date getModified() {
|
|
|
|
return modified;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setModified(Date modified) {
|
|
|
|
this.modified = modified;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getStatus() {
|
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setStatus(int status) {
|
|
|
|
this.status = status;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getVersion() {
|
|
|
|
return version;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setVersion(int version) {
|
|
|
|
this.version = version;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getGrant() {
|
|
|
|
return grant;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setGrant(String grant) {
|
|
|
|
this.grant = grant;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Date getFinalizedAt() {
|
|
|
|
return finalizedAt;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setFinalizedAt(Date finalizedAt) {
|
|
|
|
this.finalizedAt = finalizedAt;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Date getPublishedAt() {
|
|
|
|
return publishedAt;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setPublishedAt(Date publishedAt) {
|
|
|
|
this.publishedAt = publishedAt;
|
|
|
|
}
|
|
|
|
|
2020-07-03 10:23:13 +02:00
|
|
|
public int getType() {
|
2020-07-02 10:59:58 +02:00
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
2020-07-03 10:23:13 +02:00
|
|
|
public void setType(int type) {
|
2020-07-02 10:59:58 +02:00
|
|
|
this.type = type;
|
|
|
|
}
|
|
|
|
|
2020-07-03 09:43:54 +02:00
|
|
|
public List<UserInfoListingModel> getUsers() {
|
|
|
|
return users;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setUsers(List<UserInfoListingModel> users) {
|
|
|
|
this.users = users;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Boolean getPublic() {
|
|
|
|
return isPublic;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setPublic(Boolean aPublic) {
|
|
|
|
isPublic = aPublic;
|
|
|
|
}
|
|
|
|
|
2020-06-30 15:59:06 +02:00
|
|
|
public abstract RecentActivityModel fromEntity(T entity);
|
2020-07-02 10:59:58 +02:00
|
|
|
|
|
|
|
public enum RecentActivityType {
|
2020-07-03 10:23:13 +02:00
|
|
|
DMP(2), DATASET(1);
|
2020-07-02 10:59:58 +02:00
|
|
|
|
|
|
|
private final int index;
|
|
|
|
|
|
|
|
RecentActivityType(int index) {
|
|
|
|
this.index = index;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getIndex() {
|
|
|
|
return index;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static RecentActivityType fromIndex(int index) {
|
|
|
|
switch (index) {
|
|
|
|
case 2:
|
2020-07-03 10:23:13 +02:00
|
|
|
return DMP;
|
|
|
|
case 1:
|
2020-07-02 10:59:58 +02:00
|
|
|
return DATASET;
|
|
|
|
default:
|
|
|
|
throw new IllegalArgumentException("Recent Activity Type : \"" + index + "\" is not supported.");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2020-06-30 15:59:06 +02:00
|
|
|
}
|