Minor Update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@93389 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
18198f4a3b
commit
40661ff7b9
|
@ -46,8 +46,11 @@ import org.gcube.data.analysis.tabulardata.model.column.ColumnReference;
|
||||||
import org.gcube.data.analysis.tabulardata.model.column.ColumnType;
|
import org.gcube.data.analysis.tabulardata.model.column.ColumnType;
|
||||||
import org.gcube.data.analysis.tabulardata.model.column.type.CodeColumnType;
|
import org.gcube.data.analysis.tabulardata.model.column.type.CodeColumnType;
|
||||||
import org.gcube.data.analysis.tabulardata.model.column.type.CodeNameColumnType;
|
import org.gcube.data.analysis.tabulardata.model.column.type.CodeNameColumnType;
|
||||||
|
import org.gcube.data.analysis.tabulardata.model.column.type.DimensionColumnType;
|
||||||
import org.gcube.data.analysis.tabulardata.model.column.type.IdColumnType;
|
import org.gcube.data.analysis.tabulardata.model.column.type.IdColumnType;
|
||||||
|
import org.gcube.data.analysis.tabulardata.model.column.type.TimeDimensionColumnType;
|
||||||
import org.gcube.data.analysis.tabulardata.model.column.type.ValidationColumnType;
|
import org.gcube.data.analysis.tabulardata.model.column.type.ValidationColumnType;
|
||||||
|
import org.gcube.data.analysis.tabulardata.model.metadata.column.ViewColumnMetadata;
|
||||||
import org.gcube.data.analysis.tabulardata.model.metadata.common.DescriptionsMetadata;
|
import org.gcube.data.analysis.tabulardata.model.metadata.common.DescriptionsMetadata;
|
||||||
import org.gcube.data.analysis.tabulardata.model.metadata.common.ImmutableLocalizedText;
|
import org.gcube.data.analysis.tabulardata.model.metadata.common.ImmutableLocalizedText;
|
||||||
import org.gcube.data.analysis.tabulardata.model.metadata.common.LocalizedText;
|
import org.gcube.data.analysis.tabulardata.model.metadata.common.LocalizedText;
|
||||||
|
@ -103,6 +106,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.share.Contacts;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.share.ShareInfo;
|
import org.gcube.portlets.user.td.gwtservice.shared.share.ShareInfo;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.source.SDMXRegistrySource;
|
import org.gcube.portlets.user.td.gwtservice.shared.source.SDMXRegistrySource;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnViewData;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.TableData;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.TableData;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.Occurences;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.Occurences;
|
||||||
|
@ -317,6 +321,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Returns ArrayList<ColumnData> other than IdColumnType,
|
||||||
|
* ValidationColumnType, DimensionColumnType and TimeDimensionColumnType
|
||||||
*
|
*
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@ -345,10 +351,13 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
List<Column> cols = table.getColumns();
|
List<Column> cols = table.getColumns();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (Column c : cols) {
|
for (Column c : cols) {
|
||||||
if (c.getColumnType() instanceof IdColumnType) {
|
if (c.getColumnType() instanceof IdColumnType
|
||||||
|
|| c.getColumnType() instanceof ValidationColumnType
|
||||||
|
|| c.getColumnType() instanceof DimensionColumnType
|
||||||
|
|| c.getColumnType() instanceof TimeDimensionColumnType) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (c.getColumnType() instanceof ValidationColumnType) {
|
if (c.contains(ViewColumnMetadata.class)) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ColumnData cData = new ColumnData();
|
ColumnData cData = new ColumnData();
|
||||||
|
@ -399,6 +408,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Returns ArrayList<ColumnData> other than IdColumnType,
|
||||||
|
* ValidationColumnType, DimensionColumnType and TimeDimensionColumnType
|
||||||
|
*
|
||||||
*
|
*
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@ -422,10 +434,13 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
List<Column> cols = table.getColumns();
|
List<Column> cols = table.getColumns();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (Column c : cols) {
|
for (Column c : cols) {
|
||||||
if (c.getColumnType() instanceof IdColumnType) {
|
if (c.getColumnType() instanceof IdColumnType
|
||||||
|
|| c.getColumnType() instanceof ValidationColumnType
|
||||||
|
|| c.getColumnType() instanceof DimensionColumnType
|
||||||
|
|| c.getColumnType() instanceof TimeDimensionColumnType) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (c.getColumnType() instanceof ValidationColumnType) {
|
if (c.contains(ViewColumnMetadata.class)) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ColumnData cData = new ColumnData();
|
ColumnData cData = new ColumnData();
|
||||||
|
@ -502,9 +517,32 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
cData.setId(Integer.toString(0));
|
cData.setId(Integer.toString(0));
|
||||||
cData.setColumnId(c.getLocalId().getValue());
|
cData.setColumnId(c.getLocalId().getValue());
|
||||||
cData.setName(c.getName());
|
cData.setName(c.getName());
|
||||||
|
|
||||||
|
if (c.contains(ViewColumnMetadata.class)) {
|
||||||
|
ViewColumnMetadata viewMetadata = c
|
||||||
|
.getMetadata(ViewColumnMetadata.class);
|
||||||
|
logger.debug("ViewColumnMetadata: "
|
||||||
|
+ viewMetadata.toString());
|
||||||
|
|
||||||
|
String sourceTableDimensionColumnId = viewMetadata
|
||||||
|
.getSourceTableDimensionColumnId().getValue();
|
||||||
|
String targetTableColumnId = viewMetadata
|
||||||
|
.getTargetTableColumnId().getValue();
|
||||||
|
long targetTableId = viewMetadata.getTargetTableId()
|
||||||
|
.getValue();
|
||||||
|
ColumnViewData columnViewData = new ColumnViewData(
|
||||||
|
sourceTableDimensionColumnId, targetTableColumnId,
|
||||||
|
targetTableId);
|
||||||
|
cData.setColumnViewData(columnViewData);
|
||||||
|
cData.setViewColumn(true);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
cData.setViewColumn(false);
|
||||||
|
}
|
||||||
cData.setTypeCode(c.getColumnType().getCode());
|
cData.setTypeCode(c.getColumnType().getCode());
|
||||||
cData.setTypeName(c.getColumnType().getName());
|
cData.setTypeName(c.getColumnType().getName());
|
||||||
cData.setDataTypeName(c.getDataType().getName());
|
cData.setDataTypeName(c.getDataType().getName());
|
||||||
|
|
||||||
NamesMetadata labelsMetadata = null;
|
NamesMetadata labelsMetadata = null;
|
||||||
try {
|
try {
|
||||||
labelsMetadata = c.getMetadata(NamesMetadata.class);
|
labelsMetadata = c.getMetadata(NamesMetadata.class);
|
||||||
|
@ -3619,6 +3657,16 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (Column c : cols) {
|
for (Column c : cols) {
|
||||||
ColumnType ctype = c.getColumnType();
|
ColumnType ctype = c.getColumnType();
|
||||||
|
if (c.getColumnType() instanceof IdColumnType
|
||||||
|
|| c.getColumnType() instanceof ValidationColumnType
|
||||||
|
|| c.getColumnType() instanceof DimensionColumnType
|
||||||
|
|| c.getColumnType() instanceof TimeDimensionColumnType) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (c.contains(ViewColumnMetadata.class)) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
if (ctype instanceof CodeColumnType
|
if (ctype instanceof CodeColumnType
|
||||||
|| ctype instanceof CodeNameColumnType) {
|
|| ctype instanceof CodeNameColumnType) {
|
||||||
|
|
||||||
|
@ -3631,7 +3679,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
cData.setDataTypeName(c.getDataType().getName());
|
cData.setDataTypeName(c.getDataType().getName());
|
||||||
NamesMetadata labelsMetadata = null;
|
NamesMetadata labelsMetadata = null;
|
||||||
try {
|
try {
|
||||||
labelsMetadata = c.getMetadata(NamesMetadata.class);
|
labelsMetadata = c
|
||||||
|
.getMetadata(NamesMetadata.class);
|
||||||
} catch (NoSuchMetadataException e) {
|
} catch (NoSuchMetadataException e) {
|
||||||
logger.debug("labelMetadata: NoSuchMetadataException "
|
logger.debug("labelMetadata: NoSuchMetadataException "
|
||||||
+ e.getLocalizedMessage());
|
+ e.getLocalizedMessage());
|
||||||
|
@ -3648,7 +3697,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
logger.debug("ColumnLabel no label in en");
|
logger.debug("ColumnLabel no label in en");
|
||||||
} else {
|
} else {
|
||||||
cData.setLabel(cl.getValue());
|
cData.setLabel(cl.getValue());
|
||||||
logger.debug("Column Set Label: " + cl.getValue());
|
logger.debug("Column Set Label: "
|
||||||
|
+ cl.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cData.setTrId(trId);
|
cData.setTrId(trId);
|
||||||
|
@ -3656,6 +3706,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
return columns;
|
return columns;
|
||||||
|
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
|
@ -3693,6 +3746,15 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (Column c : cols) {
|
for (Column c : cols) {
|
||||||
ColumnType ctype = c.getColumnType();
|
ColumnType ctype = c.getColumnType();
|
||||||
|
if (c.getColumnType() instanceof IdColumnType
|
||||||
|
|| c.getColumnType() instanceof ValidationColumnType
|
||||||
|
|| c.getColumnType() instanceof DimensionColumnType
|
||||||
|
|| c.getColumnType() instanceof TimeDimensionColumnType) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (c.contains(ViewColumnMetadata.class)) {
|
||||||
|
|
||||||
|
} else {
|
||||||
if (ctype instanceof CodeColumnType
|
if (ctype instanceof CodeColumnType
|
||||||
|| ctype instanceof CodeNameColumnType) {
|
|| ctype instanceof CodeNameColumnType) {
|
||||||
|
|
||||||
|
@ -3705,7 +3767,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
cData.setDataTypeName(c.getDataType().getName());
|
cData.setDataTypeName(c.getDataType().getName());
|
||||||
NamesMetadata labelsMetadata = null;
|
NamesMetadata labelsMetadata = null;
|
||||||
try {
|
try {
|
||||||
labelsMetadata = c.getMetadata(NamesMetadata.class);
|
labelsMetadata = c
|
||||||
|
.getMetadata(NamesMetadata.class);
|
||||||
} catch (NoSuchMetadataException e) {
|
} catch (NoSuchMetadataException e) {
|
||||||
logger.debug("labelMetadata: NoSuchMetadataException "
|
logger.debug("labelMetadata: NoSuchMetadataException "
|
||||||
+ e.getLocalizedMessage());
|
+ e.getLocalizedMessage());
|
||||||
|
@ -3722,7 +3785,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
logger.debug("ColumnLabel no label in en");
|
logger.debug("ColumnLabel no label in en");
|
||||||
} else {
|
} else {
|
||||||
cData.setLabel(cl.getValue());
|
cData.setLabel(cl.getValue());
|
||||||
logger.debug("Column Set Label: " + cl.getValue());
|
logger.debug("Column Set Label: "
|
||||||
|
+ cl.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cData.setTrId(trId);
|
cData.setTrId(trId);
|
||||||
|
@ -3730,6 +3794,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return columns;
|
return columns;
|
||||||
|
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
|
|
|
@ -22,7 +22,8 @@ public class ColumnData implements Serializable {
|
||||||
protected String dataTypeName;
|
protected String dataTypeName;
|
||||||
protected String label;
|
protected String label;
|
||||||
protected TRId trId;
|
protected TRId trId;
|
||||||
protected ColumnViewData columnView;
|
protected boolean viewColumn;
|
||||||
|
protected ColumnViewData columnViewData;
|
||||||
|
|
||||||
public String getColumnId() {
|
public String getColumnId() {
|
||||||
return columnId;
|
return columnId;
|
||||||
|
@ -88,12 +89,20 @@ public class ColumnData implements Serializable {
|
||||||
this.label = label;
|
this.label = label;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ColumnViewData getColumnView() {
|
public ColumnViewData getColumnViewData() {
|
||||||
return columnView;
|
return columnViewData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setColumnView(ColumnViewData columnView) {
|
public void setColumnViewData(ColumnViewData columnViewData) {
|
||||||
this.columnView = columnView;
|
this.columnViewData = columnViewData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isViewColumn() {
|
||||||
|
return viewColumn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setViewColumn(boolean viewColumn) {
|
||||||
|
this.viewColumn = viewColumn;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -101,10 +110,13 @@ public class ColumnData implements Serializable {
|
||||||
return "ColumnData [id=" + id + ", columnId=" + columnId + ", name="
|
return "ColumnData [id=" + id + ", columnId=" + columnId + ", name="
|
||||||
+ name + ", typeName=" + typeName + ", typeCode=" + typeCode
|
+ name + ", typeName=" + typeName + ", typeCode=" + typeCode
|
||||||
+ ", dataTypeName=" + dataTypeName + ", label=" + label
|
+ ", dataTypeName=" + dataTypeName + ", label=" + label
|
||||||
+ ", trId=" + trId + ", columnView=" + columnView + "]";
|
+ ", trId=" + trId + ", viewColumn=" + viewColumn
|
||||||
|
+ ", columnViewData=" + columnViewData + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,25 +4,27 @@ import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @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 ColumnViewData implements Serializable {
|
public class ColumnViewData implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 6727733264842637144L;
|
private static final long serialVersionUID = 6727733264842637144L;
|
||||||
|
|
||||||
protected boolean viewColumn;
|
|
||||||
protected String sourceTableDimensionColumnId;
|
protected String sourceTableDimensionColumnId;
|
||||||
protected String targetTableColumnId;
|
protected String targetTableColumnId;
|
||||||
protected long targetTableId;
|
protected long targetTableId;
|
||||||
|
|
||||||
public boolean isViewColumn() {
|
public ColumnViewData() {
|
||||||
return viewColumn;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setViewColumn(boolean viewColumn) {
|
public ColumnViewData(String sourceTableDimensionColumnId,
|
||||||
this.viewColumn = viewColumn;
|
String targetTableColumnId, long targetTableId) {
|
||||||
|
this.sourceTableDimensionColumnId = sourceTableDimensionColumnId;
|
||||||
|
this.targetTableColumnId = targetTableColumnId;
|
||||||
|
this.targetTableId = targetTableId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSourceTableDimensionColumnId() {
|
public String getSourceTableDimensionColumnId() {
|
||||||
|
@ -52,13 +54,10 @@ public class ColumnViewData implements Serializable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "ColumnViewData [viewColumn=" + viewColumn
|
return "ColumnViewData [sourceTableDimensionColumnId="
|
||||||
+ ", sourceTableDimensionColumnId="
|
|
||||||
+ sourceTableDimensionColumnId + ", targetTableColumnId="
|
+ sourceTableDimensionColumnId + ", targetTableColumnId="
|
||||||
+ targetTableColumnId + ", targetTableId=" + targetTableId
|
+ targetTableColumnId + ", targetTableId=" + targetTableId
|
||||||
+ "]";
|
+ "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue