Updated time table retrieving
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@111392 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
078cacea93
commit
6155ecf8af
|
@ -72,6 +72,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.union.UnionSession;
|
|||
import org.gcube.portlets.user.td.gwtservice.shared.uriresolver.UriResolverSession;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.user.UserInfo;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.PeriodDataType;
|
||||
|
||||
import com.google.gwt.user.client.rpc.RemoteService;
|
||||
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
|
||||
|
@ -444,6 +445,17 @@ public interface TDGWTService extends RemoteService {
|
|||
public void tdOpen(TDOpenSession tdOpenSession)
|
||||
throws TDGWTServiceException;
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve Time Table Id
|
||||
*
|
||||
* @param periodDataType
|
||||
* @return
|
||||
* @throws TDGWTServiceException
|
||||
*/
|
||||
public Long getTimeTableId(PeriodDataType periodDataType)
|
||||
throws TDGWTServiceException;
|
||||
|
||||
/**
|
||||
* Retrieves the list of columns in the current table
|
||||
*
|
||||
|
|
|
@ -71,6 +71,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.union.UnionSession;
|
|||
import org.gcube.portlets.user.td.gwtservice.shared.uriresolver.UriResolverSession;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.user.UserInfo;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.PeriodDataType;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
|
@ -131,7 +132,9 @@ public interface TDGWTServiceAsync {
|
|||
AsyncCallback<ArrayList<TabMetadata>> callback);
|
||||
|
||||
void getTRMetadata(TRId trId, AsyncCallback<ArrayList<TRMetadata>> callback);
|
||||
|
||||
|
||||
void getTimeTableId(PeriodDataType periodDataType, AsyncCallback<Long> callback);
|
||||
|
||||
void getColumns(AsyncCallback<ArrayList<ColumnData>> callback);
|
||||
|
||||
void getColumns(TRId trId, AsyncCallback<ArrayList<ColumnData>> callback);
|
||||
|
|
|
@ -260,6 +260,8 @@ import org.gcube.portlets.user.td.gwtservice.shared.user.UserInfo;
|
|||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.operations.OperationsId;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.operations.UIOperationsId;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnTypeCode;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.PeriodDataType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.RelationshipData;
|
||||
import org.gcube.portlets.user.uriresolvermanager.UriResolverManager;
|
||||
import org.gcube.resources.discovery.client.api.DiscoveryClient;
|
||||
|
@ -779,7 +781,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
}
|
||||
}
|
||||
|
||||
protected void updateTabResourceInformation(TabResource tabResource,
|
||||
private void updateTabResourceInformation(TabResource tabResource,
|
||||
ArrayList<TRMetadata> trMetadatas) {
|
||||
|
||||
for (TRMetadata trMetadata : trMetadatas) {
|
||||
|
@ -827,6 +829,44 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return Time Table id
|
||||
*
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public Long getTimeTableId(PeriodDataType periodDataType)
|
||||
throws TDGWTServiceException {
|
||||
try {
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
ASLSession aslSession = SessionUtil.getAslSession(session);
|
||||
|
||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||
aslSession.getUsername(), aslSession.getScope()));
|
||||
TabularDataService service = TabularDataServiceFactory.getService();
|
||||
|
||||
Table table = service.getTimeTable(PeriodTypeMap
|
||||
.map(periodDataType));
|
||||
if (table == null || table.getId() == null) {
|
||||
throw new TDGWTServiceException("Error retrieving Time Table: "
|
||||
+ table);
|
||||
}
|
||||
|
||||
return table.getId().getValue();
|
||||
|
||||
} catch (TDGWTServiceException e) {
|
||||
throw e;
|
||||
} catch (SecurityException e) {
|
||||
e.printStackTrace();
|
||||
throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS);
|
||||
} catch (Throwable e) {
|
||||
logger.error(
|
||||
"Error retrieving Time Table: " + e.getLocalizedMessage(),
|
||||
e);
|
||||
throw new TDGWTServiceException("Error retrieving Time Table: "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns ArrayList<ColumnData> other than IdColumnType,
|
||||
* ValidationColumnType and ViewColumn
|
||||
|
@ -866,21 +906,29 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
if (c.contains(ViewColumnMetadata.class)) {
|
||||
|
||||
} else {
|
||||
ColumnData cData = new ColumnData();
|
||||
|
||||
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());
|
||||
|
||||
PeriodTypeMetadata periodTypeMetadata = null;
|
||||
if (c.contains(PeriodTypeMetadata.class)) {
|
||||
periodTypeMetadata = c
|
||||
.getMetadata(PeriodTypeMetadata.class);
|
||||
PeriodType periodType = periodTypeMetadata
|
||||
.getType();
|
||||
cData.setPeriodDataType(PeriodTypeMap
|
||||
.map(periodType));
|
||||
}
|
||||
|
||||
ColumnRelationship rel = c.getRelationship();
|
||||
if (rel != null) {
|
||||
RelationshipData relData = new RelationshipData(rel
|
||||
.getTargetTableId().getValue(), rel
|
||||
.getTargetColumnId().getValue());
|
||||
RelationshipData relData = retrieveRelationship(service,
|
||||
table, c, periodTypeMetadata, rel);
|
||||
cData.setRelationship(relData);
|
||||
|
||||
}
|
||||
|
||||
NamesMetadata labelsMetadata = null;
|
||||
|
@ -917,16 +965,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
cData.setLocale(dataLocaleMetadata.getLocale());
|
||||
}
|
||||
|
||||
PeriodTypeMetadata periodTypeMetadata = null;
|
||||
if (c.contains(PeriodTypeMetadata.class)) {
|
||||
periodTypeMetadata = c
|
||||
.getMetadata(PeriodTypeMetadata.class);
|
||||
PeriodType periodType = periodTypeMetadata
|
||||
.getType();
|
||||
cData.setPeriodDataType(PeriodTypeMap
|
||||
.map(periodType));
|
||||
}
|
||||
|
||||
|
||||
cData.setTrId(trId);
|
||||
columns.add(cData);
|
||||
i++;
|
||||
|
@ -991,11 +1030,21 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
cData.setTypeCode(c.getColumnType().getCode());
|
||||
cData.setTypeName(c.getColumnType().getName());
|
||||
cData.setDataTypeName(c.getDataType().getName());
|
||||
|
||||
PeriodTypeMetadata periodTypeMetadata = null;
|
||||
if (c.contains(PeriodTypeMetadata.class)) {
|
||||
periodTypeMetadata = c
|
||||
.getMetadata(PeriodTypeMetadata.class);
|
||||
PeriodType periodType = periodTypeMetadata
|
||||
.getType();
|
||||
cData.setPeriodDataType(PeriodTypeMap
|
||||
.map(periodType));
|
||||
}
|
||||
|
||||
ColumnRelationship rel = c.getRelationship();
|
||||
if (rel != null) {
|
||||
RelationshipData relData = new RelationshipData(rel
|
||||
.getTargetTableId().getValue(), rel
|
||||
.getTargetColumnId().getValue());
|
||||
RelationshipData relData = retrieveRelationship(service,
|
||||
table, c, periodTypeMetadata, rel);
|
||||
cData.setRelationship(relData);
|
||||
|
||||
}
|
||||
|
@ -1034,15 +1083,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
cData.setLocale(dataLocaleMetadata.getLocale());
|
||||
}
|
||||
|
||||
PeriodTypeMetadata periodTypeMetadata = null;
|
||||
if (c.contains(PeriodTypeMetadata.class)) {
|
||||
periodTypeMetadata = c
|
||||
.getMetadata(PeriodTypeMetadata.class);
|
||||
PeriodType periodType = periodTypeMetadata
|
||||
.getType();
|
||||
cData.setPeriodDataType(PeriodTypeMap
|
||||
.map(periodType));
|
||||
}
|
||||
|
||||
|
||||
cData.setTrId(trId);
|
||||
columns.add(cData);
|
||||
|
@ -1105,11 +1146,19 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
cData.setTypeCode(c.getColumnType().getCode());
|
||||
cData.setTypeName(c.getColumnType().getName());
|
||||
cData.setDataTypeName(c.getDataType().getName());
|
||||
|
||||
PeriodTypeMetadata periodTypeMetadata = null;
|
||||
if (c.contains(PeriodTypeMetadata.class)) {
|
||||
periodTypeMetadata = c
|
||||
.getMetadata(PeriodTypeMetadata.class);
|
||||
PeriodType periodType = periodTypeMetadata.getType();
|
||||
cData.setPeriodDataType(PeriodTypeMap.map(periodType));
|
||||
}
|
||||
|
||||
ColumnRelationship rel = c.getRelationship();
|
||||
if (rel != null) {
|
||||
RelationshipData relData = new RelationshipData(rel
|
||||
.getTargetTableId().getValue(), rel
|
||||
.getTargetColumnId().getValue());
|
||||
RelationshipData relData = retrieveRelationship(service,
|
||||
table, c, periodTypeMetadata, rel);
|
||||
cData.setRelationship(relData);
|
||||
|
||||
}
|
||||
|
@ -1148,28 +1197,12 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
cData.setLocale(dataLocaleMetadata.getLocale());
|
||||
}
|
||||
|
||||
PeriodTypeMetadata periodTypeMetadata = null;
|
||||
if (c.contains(PeriodTypeMetadata.class)) {
|
||||
periodTypeMetadata = c
|
||||
.getMetadata(PeriodTypeMetadata.class);
|
||||
PeriodType periodType = periodTypeMetadata.getType();
|
||||
cData.setPeriodDataType(PeriodTypeMap.map(periodType));
|
||||
}
|
||||
|
||||
ViewColumnMetadata viewColumnMetadata = null;
|
||||
|
||||
if (c.contains(ViewColumnMetadata.class)) {
|
||||
viewColumnMetadata = c
|
||||
.getMetadata(ViewColumnMetadata.class);
|
||||
ColumnViewData columnViewData = new ColumnViewData(
|
||||
viewColumnMetadata
|
||||
.getSourceTableDimensionColumnId()
|
||||
.getValue(), viewColumnMetadata
|
||||
.getTargetTableColumnId().getValue(),
|
||||
viewColumnMetadata.getTargetTableId()
|
||||
.getValue());
|
||||
|
||||
cData.setViewColumn(true);
|
||||
ColumnViewData columnViewData = retrieveColumnViewData(service, table, c,
|
||||
periodTypeMetadata);
|
||||
cData.setColumnViewData(columnViewData);
|
||||
cData.setViewColumn(true);
|
||||
} else {
|
||||
cData.setViewColumn(false);
|
||||
}
|
||||
|
@ -1237,13 +1270,20 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
cData.setTypeCode(c.getColumnType().getCode());
|
||||
cData.setTypeName(c.getColumnType().getName());
|
||||
cData.setDataTypeName(c.getDataType().getName());
|
||||
|
||||
PeriodTypeMetadata periodTypeMetadata = null;
|
||||
if (c.contains(PeriodTypeMetadata.class)) {
|
||||
periodTypeMetadata = c
|
||||
.getMetadata(PeriodTypeMetadata.class);
|
||||
PeriodType periodType = periodTypeMetadata.getType();
|
||||
cData.setPeriodDataType(PeriodTypeMap.map(periodType));
|
||||
}
|
||||
|
||||
ColumnRelationship rel = c.getRelationship();
|
||||
if (rel != null) {
|
||||
RelationshipData relData = new RelationshipData(rel
|
||||
.getTargetTableId().getValue(), rel
|
||||
.getTargetColumnId().getValue());
|
||||
RelationshipData relData = retrieveRelationship(service,
|
||||
table, c, periodTypeMetadata, rel);
|
||||
cData.setRelationship(relData);
|
||||
|
||||
}
|
||||
|
||||
NamesMetadata labelsMetadata = null;
|
||||
|
@ -1280,28 +1320,12 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
cData.setLocale(dataLocaleMetadata.getLocale());
|
||||
}
|
||||
|
||||
PeriodTypeMetadata periodTypeMetadata = null;
|
||||
if (c.contains(PeriodTypeMetadata.class)) {
|
||||
periodTypeMetadata = c
|
||||
.getMetadata(PeriodTypeMetadata.class);
|
||||
PeriodType periodType = periodTypeMetadata.getType();
|
||||
cData.setPeriodDataType(PeriodTypeMap.map(periodType));
|
||||
}
|
||||
|
||||
ViewColumnMetadata viewColumnMetadata = null;
|
||||
|
||||
if (c.contains(ViewColumnMetadata.class)) {
|
||||
viewColumnMetadata = c
|
||||
.getMetadata(ViewColumnMetadata.class);
|
||||
ColumnViewData columnViewData = new ColumnViewData(
|
||||
viewColumnMetadata
|
||||
.getSourceTableDimensionColumnId()
|
||||
.getValue(), viewColumnMetadata
|
||||
.getTargetTableColumnId().getValue(),
|
||||
viewColumnMetadata.getTargetTableId()
|
||||
.getValue());
|
||||
|
||||
cData.setViewColumn(true);
|
||||
ColumnViewData columnViewData = retrieveColumnViewData(service, table, c,
|
||||
periodTypeMetadata);
|
||||
cData.setColumnViewData(columnViewData);
|
||||
cData.setViewColumn(true);
|
||||
} else {
|
||||
cData.setViewColumn(false);
|
||||
}
|
||||
|
@ -1358,6 +1382,94 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
}
|
||||
}
|
||||
|
||||
private RelationshipData retrieveRelationship(TabularDataService service,
|
||||
Table table, Column c, PeriodTypeMetadata periodTypeMetadata,
|
||||
ColumnRelationship rel) throws TDGWTServiceException {
|
||||
RelationshipData relData = null;
|
||||
if (c.getColumnType().getCode()
|
||||
.compareTo(ColumnTypeCode.TIMEDIMENSION.toString()) == 0) {
|
||||
Table timeTable = service
|
||||
.getTimeTable(periodTypeMetadata.getType());
|
||||
if (timeTable == null || timeTable.getId() == null) {
|
||||
throw new TDGWTServiceException(
|
||||
"Error retrieving Time Table: " + table);
|
||||
}
|
||||
Column timeColumn = timeTable
|
||||
.getColumnByName(periodTypeMetadata.getType()
|
||||
.name());
|
||||
relData = new RelationshipData(timeTable.getId()
|
||||
.getValue(), timeColumn.getLocalId().getValue());
|
||||
|
||||
} else {
|
||||
relData = new RelationshipData(rel.getTargetTableId()
|
||||
.getValue(), rel.getTargetColumnId().getValue());
|
||||
}
|
||||
return relData;
|
||||
}
|
||||
|
||||
private ColumnViewData retrieveColumnViewData(TabularDataService service,
|
||||
Table table, Column c, PeriodTypeMetadata periodTypeMetadata)
|
||||
throws TDGWTServiceException {
|
||||
ViewColumnMetadata viewMetadata = c
|
||||
.getMetadata(ViewColumnMetadata.class);
|
||||
logger.debug("ViewColumnMetadata: "
|
||||
+ viewMetadata.toString());
|
||||
|
||||
ColumnViewData columnViewData=null;
|
||||
Column sourceColumn = table.getColumnById(viewMetadata
|
||||
.getSourceTableDimensionColumnId());
|
||||
if (sourceColumn.getColumnType().getCode()
|
||||
.compareTo(ColumnTypeCode.TIMEDIMENSION.toString()) == 0) {
|
||||
|
||||
PeriodTypeMetadata periodTypeMetadataSourceColumn = null;
|
||||
if (sourceColumn.contains(PeriodTypeMetadata.class)) {
|
||||
periodTypeMetadataSourceColumn = sourceColumn
|
||||
.getMetadata(PeriodTypeMetadata.class);
|
||||
periodTypeMetadataSourceColumn.getType();
|
||||
|
||||
Table timeTable = service
|
||||
.getTimeTable(periodTypeMetadataSourceColumn.getType());
|
||||
if (timeTable == null || timeTable.getId() == null) {
|
||||
throw new TDGWTServiceException(
|
||||
"Error retrieving Time Table: " + table);
|
||||
}
|
||||
Column timeColumn = timeTable
|
||||
.getColumnByName(periodTypeMetadata.getType()
|
||||
.name());
|
||||
|
||||
String sourceTableDimensionColumnId = viewMetadata
|
||||
.getSourceTableDimensionColumnId().getValue();
|
||||
|
||||
String targetTableColumnId = timeColumn.getLocalId().getValue();
|
||||
|
||||
long targetTableId = timeTable.getId()
|
||||
.getValue();
|
||||
columnViewData = new ColumnViewData(
|
||||
sourceTableDimensionColumnId,
|
||||
targetTableColumnId, targetTableId);
|
||||
|
||||
} else {
|
||||
logger.error("Error retrieving Time Table for view column:"+c+" , source column do not have a PeriodTypeMetadata: "+sourceColumn);
|
||||
throw new TDGWTServiceException(
|
||||
"Error retrieving Time Table, source column do not have a PeriodTypeMetadata");
|
||||
}
|
||||
|
||||
} else {
|
||||
String sourceTableDimensionColumnId = viewMetadata
|
||||
.getSourceTableDimensionColumnId().getValue();
|
||||
|
||||
String targetTableColumnId = viewMetadata
|
||||
.getTargetTableColumnId().getValue();
|
||||
long targetTableId = viewMetadata.getTargetTableId()
|
||||
.getValue();
|
||||
columnViewData = new ColumnViewData(
|
||||
sourceTableDimensionColumnId,
|
||||
targetTableColumnId, targetTableId);
|
||||
}
|
||||
return columnViewData;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* {@inheritDoc}
|
||||
|
@ -1385,37 +1497,31 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
cData.setColumnId(c.getLocalId().getValue());
|
||||
cData.setName(c.getName());
|
||||
|
||||
if (c.contains(ViewColumnMetadata.class)) {
|
||||
ViewColumnMetadata viewMetadata = c
|
||||
.getMetadata(ViewColumnMetadata.class);
|
||||
logger.debug("ViewColumnMetadata: "
|
||||
+ viewMetadata.toString());
|
||||
PeriodTypeMetadata periodTypeMetadata = null;
|
||||
if (c.contains(PeriodTypeMetadata.class)) {
|
||||
periodTypeMetadata = c
|
||||
.getMetadata(PeriodTypeMetadata.class);
|
||||
PeriodType periodType = periodTypeMetadata.getType();
|
||||
cData.setPeriodDataType(PeriodTypeMap.map(periodType));
|
||||
}
|
||||
|
||||
String sourceTableDimensionColumnId = viewMetadata
|
||||
.getSourceTableDimensionColumnId().getValue();
|
||||
String targetTableColumnId = viewMetadata
|
||||
.getTargetTableColumnId().getValue();
|
||||
long targetTableId = viewMetadata.getTargetTableId()
|
||||
.getValue();
|
||||
ColumnViewData columnViewData = new ColumnViewData(
|
||||
sourceTableDimensionColumnId, targetTableColumnId,
|
||||
targetTableId);
|
||||
if (c.contains(ViewColumnMetadata.class)) {
|
||||
ColumnViewData columnViewData = retrieveColumnViewData(service, table, c,
|
||||
periodTypeMetadata);
|
||||
cData.setColumnViewData(columnViewData);
|
||||
cData.setViewColumn(true);
|
||||
|
||||
} else {
|
||||
cData.setViewColumn(false);
|
||||
}
|
||||
|
||||
cData.setTypeCode(c.getColumnType().getCode());
|
||||
cData.setTypeName(c.getColumnType().getName());
|
||||
cData.setDataTypeName(c.getDataType().getName());
|
||||
ColumnRelationship rel = c.getRelationship();
|
||||
if (rel != null) {
|
||||
RelationshipData relData = new RelationshipData(rel
|
||||
.getTargetTableId().getValue(), rel
|
||||
.getTargetColumnId().getValue());
|
||||
RelationshipData relData = retrieveRelationship(service,
|
||||
table, c, periodTypeMetadata, rel);
|
||||
cData.setRelationship(relData);
|
||||
|
||||
}
|
||||
|
||||
NamesMetadata labelsMetadata = null;
|
||||
|
@ -1450,14 +1556,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
cData.setLocale(dataLocaleMetadata.getLocale());
|
||||
}
|
||||
|
||||
PeriodTypeMetadata periodTypeMetadata = null;
|
||||
if (c.contains(PeriodTypeMetadata.class)) {
|
||||
periodTypeMetadata = c
|
||||
.getMetadata(PeriodTypeMetadata.class);
|
||||
PeriodType periodType = periodTypeMetadata.getType();
|
||||
cData.setPeriodDataType(PeriodTypeMap.map(periodType));
|
||||
}
|
||||
|
||||
cData.setTrId(trId);
|
||||
|
||||
}
|
||||
|
@ -1477,6 +1575,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* {@inheritDoc}
|
||||
|
@ -1503,25 +1603,20 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
cData.setId(Integer.toString(0));
|
||||
cData.setColumnId(c.getLocalId().getValue());
|
||||
cData.setName(c.getName());
|
||||
|
||||
|
||||
PeriodTypeMetadata periodTypeMetadata = null;
|
||||
if (c.contains(PeriodTypeMetadata.class)) {
|
||||
periodTypeMetadata = c
|
||||
.getMetadata(PeriodTypeMetadata.class);
|
||||
PeriodType periodType = periodTypeMetadata.getType();
|
||||
cData.setPeriodDataType(PeriodTypeMap.map(periodType));
|
||||
}
|
||||
|
||||
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);
|
||||
ColumnViewData columnViewData = retrieveColumnViewData(service, table, c,
|
||||
periodTypeMetadata);
|
||||
cData.setColumnViewData(columnViewData);
|
||||
cData.setViewColumn(true);
|
||||
|
||||
} else {
|
||||
cData.setViewColumn(false);
|
||||
}
|
||||
|
@ -1530,11 +1625,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
cData.setDataTypeName(c.getDataType().getName());
|
||||
ColumnRelationship rel = c.getRelationship();
|
||||
if (rel != null) {
|
||||
RelationshipData relData = new RelationshipData(rel
|
||||
.getTargetTableId().getValue(), rel
|
||||
.getTargetColumnId().getValue());
|
||||
RelationshipData relData = retrieveRelationship(service,
|
||||
table, c, periodTypeMetadata, rel);
|
||||
cData.setRelationship(relData);
|
||||
|
||||
}
|
||||
NamesMetadata labelsMetadata = null;
|
||||
if (c.contains(NamesMetadata.class)) {
|
||||
|
@ -1568,13 +1661,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
cData.setLocale(dataLocaleMetadata.getLocale());
|
||||
}
|
||||
|
||||
PeriodTypeMetadata periodTypeMetadata = null;
|
||||
if (c.contains(PeriodTypeMetadata.class)) {
|
||||
periodTypeMetadata = c
|
||||
.getMetadata(PeriodTypeMetadata.class);
|
||||
PeriodType periodType = periodTypeMetadata.getType();
|
||||
cData.setPeriodDataType(PeriodTypeMap.map(periodType));
|
||||
}
|
||||
|
||||
|
||||
cData.setTrId(trId);
|
||||
|
||||
|
@ -2102,7 +2189,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
* @param tr
|
||||
* @param tabResource
|
||||
*/
|
||||
protected void syncTRMetaData(TabularResource tr, TabResource tabResource) {
|
||||
private void syncTRMetaData(TabularResource tr, TabResource tabResource) {
|
||||
|
||||
logger.debug("TRservice [id:" + tr.getId() + " ,creationDate:"
|
||||
+ tr.getCreationDate() + "]");
|
||||
|
@ -2175,12 +2262,13 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
*
|
||||
* @param tr
|
||||
* @throws TDGWTServiceException
|
||||
*/
|
||||
protected void retrieveTRMetadataFromServiceAndLastTable(
|
||||
*
|
||||
private TabResource retrieveTRMetadataFromServiceAndLastTable(
|
||||
TabularDataService service, TabularResource tr)
|
||||
throws TDGWTServiceException {
|
||||
retrieveTRMetadataFromServiceAndLastTable(service, tr, 0);
|
||||
return retrieveTRMetadataFromServiceAndLastTable(service, tr, 0);
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Retrieves the informations for a specific Tabular Resource from service
|
||||
|
@ -2193,7 +2281,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
* @return TabResource for Grid
|
||||
* @throws TDGWTServiceException
|
||||
*/
|
||||
protected TabResource retrieveTRMetadataFromService(
|
||||
private TabResource retrieveTRMetadataFromService(
|
||||
TabularDataService service, TabularResource tr, int i)
|
||||
throws TDGWTServiceException {
|
||||
try {
|
||||
|
@ -2294,7 +2382,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
* @return TabResource for Grid
|
||||
* @throws TDGWTServiceException
|
||||
*/
|
||||
protected TabResource retrieveTRMetadataFromServiceAndLastTable(
|
||||
private TabResource retrieveTRMetadataFromServiceAndLastTable(
|
||||
TabularDataService service, TabularResource tr, int i)
|
||||
throws TDGWTServiceException {
|
||||
Table table = null;
|
||||
|
@ -2503,7 +2591,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
}
|
||||
|
||||
protected ArrayList<TabResource> filterPagingRow(
|
||||
private ArrayList<TabResource> filterPagingRow(
|
||||
CodelistPagingLoadConfig plc, ArrayList<TabResource> ltr,
|
||||
HttpSession session) {
|
||||
String filter = SessionUtil.getCodelistsPagingLoadedFilter(session);
|
||||
|
@ -2579,7 +2667,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
}
|
||||
|
||||
protected ArrayList<TabResource> OrderPagingRow(
|
||||
private ArrayList<TabResource> OrderPagingRow(
|
||||
CodelistPagingLoadConfig plc, ArrayList<TabResource> ltrCopy,
|
||||
HttpSession session) {
|
||||
|
||||
|
@ -3076,7 +3164,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
* @return
|
||||
* @throws TDGWTServiceException
|
||||
*/
|
||||
protected TRId retrieveTabularResourceBasicData(TRId trId)
|
||||
private TRId retrieveTabularResourceBasicData(TRId trId)
|
||||
throws TDGWTServiceException {
|
||||
try {
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
|
@ -3388,7 +3476,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
* @param csvImportSession
|
||||
* @return
|
||||
*/
|
||||
protected Map<String, Object> csvImportFileParameter(
|
||||
private Map<String, Object> csvImportFileParameter(
|
||||
String fileUrlOnStorage, CSVFileUploadSession fileUploadSession,
|
||||
CSVImportSession csvImportSession) {
|
||||
Map<String, Object> parameterInstances = new HashMap<String, Object>();
|
||||
|
@ -3418,11 +3506,11 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
* @param csvImportSession
|
||||
* @throws TDGWTServiceException
|
||||
*/
|
||||
protected String loadCSVFileOnStorage(String user,
|
||||
private String loadCSVFileOnStorage(String user,
|
||||
CSVFileUploadSession fileUploadSession,
|
||||
CSVImportSession csvImportSession) throws TDGWTServiceException {
|
||||
String fileUrlOnStorage=null;
|
||||
|
||||
String fileUrlOnStorage = null;
|
||||
|
||||
logger.debug("File Storage Access");
|
||||
|
||||
logger.debug("CSVImportSession skip:"
|
||||
|
@ -3457,7 +3545,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
return fileUrlOnStorage;
|
||||
}
|
||||
|
||||
protected String importCSVFileOnService(HttpSession session,
|
||||
private String importCSVFileOnService(HttpSession session,
|
||||
ASLSession aslSession, String user, String fileUrlOnStorage,
|
||||
CSVFileUploadSession fileUploadSession,
|
||||
CSVImportSession csvImportSession) throws TDGWTServiceException {
|
||||
|
@ -3737,7 +3825,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
}
|
||||
}
|
||||
|
||||
protected ArrayList<TRMetadata> getTRMetadata(TabularResource tr)
|
||||
private ArrayList<TRMetadata> getTRMetadata(TabularResource tr)
|
||||
throws TDGWTServiceException {
|
||||
try {
|
||||
|
||||
|
@ -4124,7 +4212,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
* @param exportSession
|
||||
* @return
|
||||
*/
|
||||
protected Map<String, Object> sdmxExportParameter(
|
||||
private Map<String, Object> sdmxExportParameter(
|
||||
SDMXExportSession exportSession) throws TDGWTServiceException {
|
||||
boolean internalRegistry = false;
|
||||
String destination = null;// Es:
|
||||
|
@ -4185,7 +4273,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
* @param trId
|
||||
* @throws TDGWTServiceException
|
||||
*/
|
||||
protected void checkTRId(TRId trId) throws TDGWTServiceException {
|
||||
private void checkTRId(TRId trId) throws TDGWTServiceException {
|
||||
if (trId == null) {
|
||||
logger.error("TRId is null");
|
||||
new TDGWTServiceException(NO_VALID_TABULAR_RESOURCE_ID_PRESENT);
|
||||
|
@ -4203,7 +4291,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
* @param trId
|
||||
* @throws TDGWTServiceException
|
||||
*/
|
||||
protected void checkTabularResourceLocked(TabularResource tabularResource)
|
||||
private void checkTabularResourceLocked(TabularResource tabularResource)
|
||||
throws TDGWTServiceException {
|
||||
try {
|
||||
|
||||
|
@ -4228,7 +4316,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
* @param trId
|
||||
* @throws TDGWTServiceException
|
||||
*/
|
||||
protected void checkTabularResourceIsFinal(TabularResource tabularResource)
|
||||
private void checkTabularResourceIsFinal(TabularResource tabularResource)
|
||||
throws TDGWTServiceException {
|
||||
try {
|
||||
if (tabularResource.isFinalized()) {
|
||||
|
@ -4252,7 +4340,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
* @param trId
|
||||
* @throws TDGWTServiceException
|
||||
*/
|
||||
protected void checkTabularResourceIsFlow(TabularResource tabularResource)
|
||||
private void checkTabularResourceIsFlow(TabularResource tabularResource)
|
||||
throws TDGWTServiceException {
|
||||
try {
|
||||
|
||||
|
@ -5076,15 +5164,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
cData.setLocale(dataLocaleMetadata.getLocale());
|
||||
}
|
||||
|
||||
PeriodTypeMetadata periodTypeMetadata = null;
|
||||
if (c.contains(PeriodTypeMetadata.class)) {
|
||||
periodTypeMetadata = c
|
||||
.getMetadata(PeriodTypeMetadata.class);
|
||||
PeriodType periodType = periodTypeMetadata
|
||||
.getType();
|
||||
cData.setPeriodDataType(PeriodTypeMap
|
||||
.map(periodType));
|
||||
}
|
||||
|
||||
|
||||
cData.setTrId(trId);
|
||||
columns.add(cData);
|
||||
|
@ -5319,7 +5399,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
}
|
||||
|
||||
protected ArrayList<Contacts> retrieveShareInfo(TabularResource tr)
|
||||
private ArrayList<Contacts> retrieveShareInfo(TabularResource tr)
|
||||
throws TDGWTServiceException {
|
||||
try {
|
||||
|
||||
|
@ -5702,7 +5782,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
}
|
||||
|
||||
protected ArrayList<Contacts> retrieveTemplateShareInfo(
|
||||
private ArrayList<Contacts> retrieveTemplateShareInfo(
|
||||
TemplateDescription templateDescription)
|
||||
throws TDGWTServiceException {
|
||||
try {
|
||||
|
@ -6527,7 +6607,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
OpExecutionDirector director = new OpExecutionDirector();
|
||||
director.setOperationExecutionBuilder(opEx);
|
||||
director.constructOperationExecution();
|
||||
|
||||
|
||||
ArrayList<OperationExecution> invocation = director
|
||||
.getListOperationExecution();
|
||||
|
||||
|
@ -6538,7 +6618,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
logger.debug("OperationInvocation: \n" + invocation.toString());
|
||||
Task trTask = service.executeBatch(invocation, tabularResourceId);
|
||||
|
||||
|
||||
logger.debug("Start Task on service: TaskId " + trTask.getId());
|
||||
|
||||
TaskWrapper taskWrapper = new TaskWrapper(trTask,
|
||||
|
@ -7180,7 +7260,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
* @param codelistMappingSession
|
||||
* @throws TDGWTServiceException
|
||||
*/
|
||||
protected String importCodelistMappingFileOnService(HttpSession session,
|
||||
private String importCodelistMappingFileOnService(HttpSession session,
|
||||
ASLSession aslSession, String user,
|
||||
CodelistMappingSession codelistMappingSession) throws Throwable {
|
||||
|
||||
|
|
Loading…
Reference in New Issue