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,11 +5,12 @@ package org.gcube.portlets.user.tdwx.shared.model;
import java.io.Serializable; import java.io.Serializable;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.RelationshipData;
/** /**
* *
* @author "Giancarlo Panichi" * @author "Giancarlo Panichi" <a
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a> * href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* *
*/ */
public class ColumnDefinition implements Serializable { public class ColumnDefinition implements Serializable {
@ -18,11 +19,24 @@ public class ColumnDefinition implements Serializable {
protected String id; // Column Name on service protected String id; // Column Name on service
protected String columnLocalId; // ColumnLocalId on service protected String columnLocalId; // ColumnLocalId on service
protected boolean viewColumn;
protected String sourceTableDimensionColumnId;
protected String targetTableColumnId;
protected long targetTableId;
protected String label; // Label 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 locale; protected String locale;
protected ValueType valueType; protected ValueType valueType;
@ -37,12 +51,16 @@ public class ColumnDefinition implements Serializable {
protected ColumnKey key; protected ColumnKey key;
public ColumnDefinition(){} public ColumnDefinition() {
}
/** /**
* Creates a new column definition with type {@link ColumnType} USER. * 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.id = id;
@ -52,18 +70,27 @@ public class ColumnDefinition implements Serializable {
this.position = -1; this.position = -1;
} }
/** /**
* Creates a new column definition. * Creates a new column definition.
* @param id the column id. *
* @param label the column label. * @param id
* @param valueType the type of column values. * the column id.
* @param width the column width. * @param label
* @param editable flag for editability. * the column label.
* @param visible flag for visibility. * @param valueType
* @param type the column type. * 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(id, columnLocalId, label);
this.valueType = valueType; this.valueType = valueType;
this.width = width; 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) { public void setValueType(ValueType valueType) {
this.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) { public void setPosition(int position) {
this.position = position; this.position = position;
} }
/** /**
* @return the editable * @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) { public void setEditable(boolean editable) {
this.editable = 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) { public void setWidth(int width) {
this.width = 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) { public void setVisible(boolean visible) {
this.visible = 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) { public void setType(ColumnType type) {
this.type = 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) { public void setIndex(int index) {
this.key = new ColumnKey(id, index); this.key = new ColumnKey(id, index);
@ -191,7 +226,6 @@ public class ColumnDefinition implements Serializable {
this.tooltipMessage = tooltipMessage; this.tooltipMessage = tooltipMessage;
} }
public String getColumnTypeName() { public String getColumnTypeName() {
return columnTypeName; return columnTypeName;
} }
@ -208,7 +242,6 @@ public class ColumnDefinition implements Serializable {
this.columnDataType = columnDataType; this.columnDataType = columnDataType;
} }
public String getColumnLocalId() { public String getColumnLocalId() {
return columnLocalId; return columnLocalId;
} }
@ -229,7 +262,8 @@ public class ColumnDefinition implements Serializable {
return sourceTableDimensionColumnId; return sourceTableDimensionColumnId;
} }
public void setSourceTableDimensionColumnId(String sourceTableDimensionColumnId) { public void setSourceTableDimensionColumnId(
String sourceTableDimensionColumnId) {
this.sourceTableDimensionColumnId = sourceTableDimensionColumnId; this.sourceTableDimensionColumnId = sourceTableDimensionColumnId;
} }
@ -261,20 +295,31 @@ public class ColumnDefinition implements Serializable {
this.locale = locale; this.locale = locale;
} }
public RelationshipData getRelationshipData() {
return relationshipData;
}
public void setRelationshipData(RelationshipData relationshipData) {
this.relationshipData = relationshipData;
}
@Override @Override
public String toString() { public String toString() {
return "ColumnDefinition [id=" + id + ", columnLocalId=" return "ColumnDefinition [id=" + id + ", columnLocalId="
+ columnLocalId + ", viewColumn=" + viewColumn + columnLocalId + ", label=" + label + ", relationshipData="
+ relationshipData + ", viewColumn=" + viewColumn
+ ", sourceTableDimensionColumnId=" + ", sourceTableDimensionColumnId="
+ sourceTableDimensionColumnId + ", targetTableColumnId=" + sourceTableDimensionColumnId + ", targetTableColumnId="
+ targetTableColumnId + ", targetTableId=" + targetTableId + targetTableColumnId + ", targetTableId=" + targetTableId
+ ", label=" + label + ", locale=" + locale + ", valueType=" + ", locale=" + locale + ", valueType=" + valueType
+ valueType + ", width=" + width + ", editable=" + editable + ", width=" + width + ", editable=" + editable + ", visible="
+ ", visible=" + visible + ", type=" + type + ", position=" + visible + ", type=" + type + ", position=" + position
+ position + ", tooltipMessage=" + tooltipMessage + ", tooltipMessage=" + tooltipMessage + ", columnTypeName="
+ ", columnTypeName=" + columnTypeName + ", columnDataType=" + columnTypeName + ", columnDataType=" + columnDataType
+ columnDataType + ", key=" + key + "]"; + ", key=" + key + "]";
} }
} }