From 02423fe30dd4a7f4ae54c1e821ba971a685d12c7 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Thu, 19 Jun 2014 11:08:57 +0000 Subject: [PATCH] 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 --- .../tdwx/shared/model/ColumnDefinition.java | 135 ++++++++++++------ 1 file changed, 90 insertions(+), 45 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/tdwx/shared/model/ColumnDefinition.java b/src/main/java/org/gcube/portlets/user/tdwx/shared/model/ColumnDefinition.java index fe4d0d0..29ad2b9 100644 --- a/src/main/java/org/gcube/portlets/user/tdwx/shared/model/ColumnDefinition.java +++ b/src/main/java/org/gcube/portlets/user/tdwx/shared/model/ColumnDefinition.java @@ -5,26 +5,40 @@ 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" - * g.panichi@isti.cnr.it - * + * @author "Giancarlo Panichi" g.panichi@isti.cnr.it + * */ 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 label; // Label + + //References for Dimenson and TimeDimension Column + protected RelationshipData relationshipData; - protected String id; //Column Name on service - protected String columnLocalId; //ColumnLocalId on service 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 String locale; + protected ValueType valueType; protected int width; protected boolean editable; @@ -34,36 +48,49 @@ public class ColumnDefinition implements Serializable { protected String tooltipMessage; protected String columnTypeName; protected String columnDataType; - + 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,12 +121,13 @@ 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; } - + /** * @return the position */ @@ -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; } @@ -207,8 +241,7 @@ public class ColumnDefinition implements Serializable { public void setColumnDataType(String columnDataType) { 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; } @@ -252,7 +286,7 @@ public class ColumnDefinition implements Serializable { public void setLabel(String label) { this.label = label; } - + public String getLocale() { return locale; } @@ -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 + "]"; } + + }