Update getColumn

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@90170 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-01-16 16:29:27 +00:00
parent b48a59d116
commit 707f74ed2a
2 changed files with 34 additions and 12 deletions

View File

@ -280,13 +280,15 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
int i = 0;
for (Column c : cols) {
if (c.getColumnType() instanceof IdColumnType) {
} else {
ColumnData cData = new ColumnData();
cData.setId(Integer.toString(i));
cData.setColumnId(c.getLocalId().getValue());
cData.setName(c.getName());
cData.setTypeCode(c.getColumnType().getCode());
cData.setTypeName(c.getColumnType().getName());
cData.setDataTypeName(c.getDataType().getName());
NamesMetadata labelsMetadata = null;
try {
labelsMetadata = c.getMetadata(NamesMetadata.class);
@ -349,13 +351,15 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
int i = 0;
for (Column c : cols) {
if (c.getColumnType() instanceof IdColumnType) {
} else {
ColumnData cData = new ColumnData();
cData.setId(Integer.toString(i));
cData.setColumnId(c.getLocalId().getValue());
cData.setName(c.getName());
cData.setTypeCode(c.getColumnType().getCode());
cData.setTypeName(c.getColumnType().getName());
cData.setDataTypeName(c.getDataType().getName());
NamesMetadata labelsMetadata = null;
try {
labelsMetadata = c.getMetadata(NamesMetadata.class);
@ -416,17 +420,14 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
Column c = table.getColumnByName(columnName);
if (c.getColumnType() instanceof IdColumnType) {
cData.setId(Integer.toString(0));
cData.setName("Id");
cData.setLabel("Id");
cData.setTypeCode(c.getColumnType().getCode());
cData.setTypeName(c.getColumnType().getName());
cData.setTrId(trId);
} else {
cData.setId(Integer.toString(0));
cData.setColumnId(c.getLocalId().getValue());
cData.setName(c.getName());
cData.setTypeCode(c.getColumnType().getCode());
cData.setTypeName(c.getColumnType().getName());
cData.setDataTypeName(c.getDataType().getName());
NamesMetadata labelsMetadata = null;
try {
labelsMetadata = c.getMetadata(NamesMetadata.class);
@ -494,9 +495,11 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
ArrayList<ColumnData> lColumnData = new ArrayList<ColumnData>();
for (Column column : table.getColumns()) {
ColumnData colData = new ColumnData();
colData.setColumnId(column.getLocalId().getValue());
colData.setName(column.getName());
colData.setTypeName(column.getColumnType().getName());
colData.setTypeCode(column.getColumnType().getCode());
colData.setDataTypeName(column.getDataType().getName());
lColumnData.add(colData);
}

View File

@ -15,12 +15,22 @@ public class ColumnData implements Serializable {
private static final long serialVersionUID = 7614033455605898209L;
protected String id; // For insert in table only
protected String columnId; //Id of column on server
protected String name;
protected String typeName;
protected String typeCode;
protected String dataTypeName;
protected String label;
protected TRId trId;
public String getColumnId() {
return columnId;
}
public void setColumnId(String columnId) {
this.columnId = columnId;
}
public String getName() {
return name;
}
@ -61,6 +71,14 @@ public class ColumnData implements Serializable {
this.id = id;
}
public String getDataTypeName() {
return dataTypeName;
}
public void setDataTypeName(String dataTypeName) {
this.dataTypeName = dataTypeName;
}
public String getLabel() {
return label;
}
@ -71,11 +89,12 @@ public class ColumnData implements Serializable {
@Override
public String toString() {
return "ColumnData [id=" + id + ", name=" + name + ", typeName="
+ typeName + ", typeCode=" + typeCode + ", label=" + label
return "ColumnData [id=" + id + ", columnId=" + columnId + ", name="
+ name + ", typeName=" + typeName + ", typeCode=" + typeCode
+ ", dataTypeName=" + dataTypeName + ", label=" + label
+ ", trId=" + trId + "]";
}
}