Updated ColumnDefinition with RealtionshipData

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-widgetx@97539 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-06-19 11:08:57 +00:00 committed by Giancarlo Panichi
parent 3589a66200
commit 02423fe30d
1 changed files with 90 additions and 45 deletions

View File

@ -5,24 +5,38 @@ package org.gcube.portlets.user.tdwx.shared.model;
import java.io.Serializable;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.RelationshipData;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ColumnDefinition implements Serializable {
private static final long serialVersionUID = 3736483086021088831L;
protected String id; //Column Name on service
protected String columnLocalId; //ColumnLocalId on service
protected String id; // Column Name on service
protected String columnLocalId; // ColumnLocalId on service
protected String label; // Label
//References for Dimenson and TimeDimension Column
protected RelationshipData relationshipData;
protected boolean viewColumn;
// View Column References
// Id column inside current table for index of
// Dimension and TimeDimension
protected String sourceTableDimensionColumnId;
// Column id inside external table for
// Dimension and TimeDimension
protected String targetTableColumnId;
// Table id inside external for Dimension and
// TimeDimension
protected long targetTableId;
protected String label; //Label
protected String locale;
protected ValueType valueType;
@ -37,33 +51,46 @@ public class ColumnDefinition implements Serializable {
protected ColumnKey key;
public ColumnDefinition(){}
public ColumnDefinition() {
}
/**
* Creates a new column definition with type {@link ColumnType} USER.
* @param id the column id.
* @param label the column label.
*
* @param id
* the column id.
* @param label
* the column label.
*/
public ColumnDefinition(String id, String columnLocalId,String label) {
public ColumnDefinition(String id, String columnLocalId, String label) {
this.id = id;
this.columnLocalId=columnLocalId;
this.columnLocalId = columnLocalId;
this.label = label;
this.type = ColumnType.USER;
this.position = -1;
}
/**
* Creates a new column definition.
* @param id the column id.
* @param label the column label.
* @param valueType the type of column values.
* @param width the column width.
* @param editable flag for editability.
* @param visible flag for visibility.
* @param type the column type.
*
* @param id
* the column id.
* @param label
* the column label.
* @param valueType
* the type of column values.
* @param width
* the column width.
* @param editable
* flag for editability.
* @param visible
* flag for visibility.
* @param type
* the column type.
*/
public ColumnDefinition(String id, String columnLocalId, String label, ValueType valueType, int width, boolean editable, boolean visible, ColumnType type) {
public ColumnDefinition(String id, String columnLocalId, String label,
ValueType valueType, int width, boolean editable, boolean visible,
ColumnType type) {
this(id, columnLocalId, label);
this.valueType = valueType;
this.width = width;
@ -94,7 +121,8 @@ public class ColumnDefinition implements Serializable {
}
/**
* @param valueType the valueType to set
* @param valueType
* the valueType to set
*/
public void setValueType(ValueType valueType) {
this.valueType = valueType;
@ -108,11 +136,13 @@ public class ColumnDefinition implements Serializable {
}
/**
* @param position the position to set
* @param position
* the position to set
*/
public void setPosition(int position) {
this.position = position;
}
/**
* @return the editable
*/
@ -121,7 +151,8 @@ public class ColumnDefinition implements Serializable {
}
/**
* @param editable the editable to set
* @param editable
* the editable to set
*/
public void setEditable(boolean editable) {
this.editable = editable;
@ -135,7 +166,8 @@ public class ColumnDefinition implements Serializable {
}
/**
* @param width the width to set
* @param width
* the width to set
*/
public void setWidth(int width) {
this.width = width;
@ -149,7 +181,8 @@ public class ColumnDefinition implements Serializable {
}
/**
* @param visible the visible to set
* @param visible
* the visible to set
*/
public void setVisible(boolean visible) {
this.visible = visible;
@ -163,7 +196,8 @@ public class ColumnDefinition implements Serializable {
}
/**
* @param type the type to set
* @param type
* the type to set
*/
public void setType(ColumnType type) {
this.type = type;
@ -177,7 +211,8 @@ public class ColumnDefinition implements Serializable {
}
/**
* @param index to set
* @param index
* to set
*/
public void setIndex(int index) {
this.key = new ColumnKey(id, index);
@ -191,7 +226,6 @@ public class ColumnDefinition implements Serializable {
this.tooltipMessage = tooltipMessage;
}
public String getColumnTypeName() {
return columnTypeName;
}
@ -208,7 +242,6 @@ public class ColumnDefinition implements Serializable {
this.columnDataType = columnDataType;
}
public String getColumnLocalId() {
return columnLocalId;
}
@ -229,7 +262,8 @@ public class ColumnDefinition implements Serializable {
return sourceTableDimensionColumnId;
}
public void setSourceTableDimensionColumnId(String sourceTableDimensionColumnId) {
public void setSourceTableDimensionColumnId(
String sourceTableDimensionColumnId) {
this.sourceTableDimensionColumnId = sourceTableDimensionColumnId;
}
@ -261,20 +295,31 @@ public class ColumnDefinition implements Serializable {
this.locale = locale;
}
public RelationshipData getRelationshipData() {
return relationshipData;
}
public void setRelationshipData(RelationshipData relationshipData) {
this.relationshipData = relationshipData;
}
@Override
public String toString() {
return "ColumnDefinition [id=" + id + ", columnLocalId="
+ columnLocalId + ", viewColumn=" + viewColumn
+ columnLocalId + ", label=" + label + ", relationshipData="
+ relationshipData + ", viewColumn=" + viewColumn
+ ", sourceTableDimensionColumnId="
+ sourceTableDimensionColumnId + ", targetTableColumnId="
+ targetTableColumnId + ", targetTableId=" + targetTableId
+ ", label=" + label + ", locale=" + locale + ", valueType="
+ valueType + ", width=" + width + ", editable=" + editable
+ ", visible=" + visible + ", type=" + type + ", position="
+ position + ", tooltipMessage=" + tooltipMessage
+ ", columnTypeName=" + columnTypeName + ", columnDataType="
+ columnDataType + ", key=" + key + "]";
+ ", locale=" + locale + ", valueType=" + valueType
+ ", width=" + width + ", editable=" + editable + ", visible="
+ visible + ", type=" + type + ", position=" + position
+ ", tooltipMessage=" + tooltipMessage + ", columnTypeName="
+ columnTypeName + ", columnDataType=" + columnDataType
+ ", key=" + key + "]";
}
}