151 lines
2.6 KiB
Java
151 lines
2.6 KiB
Java
package org.gcube.portlets.user.dataminermanager.client.bean;
|
|
|
|
import java.io.Serializable;
|
|
import java.util.Date;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
|
|
|
|
|
/**
|
|
*
|
|
* @author Giancarlo Panichi
|
|
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
|
*
|
|
*/
|
|
public class ResourceItem implements Serializable {
|
|
|
|
private static final long serialVersionUID = 2814548224382024267L;
|
|
private List<String> columnNames = new ArrayList<String>();
|
|
|
|
private Type type;
|
|
private String id;
|
|
private String name;
|
|
private String description;
|
|
private String template;
|
|
private Provenance provenance;
|
|
private Date creationDate;
|
|
private String operatorId;
|
|
private String url;
|
|
private Operator operator;
|
|
|
|
|
|
|
|
public enum Provenance {
|
|
IMPORTED,
|
|
COMPUTED,
|
|
SYSTEM
|
|
};
|
|
|
|
public enum Type {
|
|
TABLE,
|
|
FILE
|
|
}
|
|
|
|
public ResourceItem() {
|
|
super();
|
|
}
|
|
|
|
|
|
public ResourceItem(Type type, String id, String name, String description,
|
|
String template, Provenance provenance, Date creationDate,
|
|
String operatorId, String url) {
|
|
this.type=type;
|
|
this.id= id;
|
|
this.name=name;
|
|
this.description=description;
|
|
this.template=template;
|
|
this.provenance=provenance;
|
|
this.creationDate=creationDate;
|
|
this.operatorId=operatorId;
|
|
this.url=url;
|
|
}
|
|
|
|
|
|
public void setColumnNames(List<String> columnNames) {
|
|
this.columnNames = columnNames;
|
|
}
|
|
|
|
/**
|
|
* @return the columnNames
|
|
*/
|
|
public List<String> getColumnNames() {
|
|
return columnNames;
|
|
}
|
|
|
|
/**
|
|
* @param columnName
|
|
*/
|
|
public void addColumnName(String columnName) {
|
|
this.columnNames.add(columnName);
|
|
}
|
|
|
|
public Operator getOperator() {
|
|
if (operator==null) {
|
|
OperatorsClassification classification = DataMinerManager.getDefaultOperatorsClassification();
|
|
if (classification!=null)
|
|
operator=classification.getOperatorById(operatorId);
|
|
}
|
|
return operator;
|
|
}
|
|
|
|
|
|
|
|
public boolean isFile() {
|
|
return type==Type.FILE;
|
|
}
|
|
|
|
public boolean isTable() {
|
|
return type==Type.TABLE;
|
|
}
|
|
|
|
|
|
public Type getType() {
|
|
return type;
|
|
}
|
|
|
|
|
|
public String getId() {
|
|
return id;
|
|
}
|
|
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
|
|
public String getDescription() {
|
|
return description;
|
|
}
|
|
|
|
|
|
public String getTemplate() {
|
|
return template;
|
|
}
|
|
|
|
|
|
public Provenance getProvenance() {
|
|
return provenance;
|
|
}
|
|
|
|
|
|
public Date getCreationDate() {
|
|
return creationDate;
|
|
}
|
|
|
|
|
|
public String getOperatorId() {
|
|
return operatorId;
|
|
}
|
|
|
|
|
|
public String getUrl() {
|
|
return url;
|
|
}
|
|
|
|
|
|
|
|
}
|