Added Pending Tasks Retrieve
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@111471 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
d7495ce2a3
commit
2032afb8bb
|
@ -105,6 +105,15 @@ public interface TDGWTService extends RemoteService {
|
||||||
*/
|
*/
|
||||||
public UserInfo hello() throws TDGWTServiceException;
|
public UserInfo hello() throws TDGWTServiceException;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve pending Tasks and set them as background tasks
|
||||||
|
*
|
||||||
|
* @throws TDGWTServiceException
|
||||||
|
*/
|
||||||
|
public Integer pendingTasksRetrieve() throws TDGWTServiceException;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Restore UI session
|
* Restore UI session
|
||||||
*
|
*
|
||||||
|
|
|
@ -90,6 +90,8 @@ public interface TDGWTServiceAsync {
|
||||||
|
|
||||||
void hello(AsyncCallback<UserInfo> callback);
|
void hello(AsyncCallback<UserInfo> callback);
|
||||||
|
|
||||||
|
void pendingTasksRetrieve(AsyncCallback<Integer> callback);
|
||||||
|
|
||||||
void restoreUISession(AsyncCallback<TRId> callback);
|
void restoreUISession(AsyncCallback<TRId> callback);
|
||||||
|
|
||||||
void getUriFromResolver(UriResolverSession uriResolverSession,
|
void getUriFromResolver(UriResolverSession uriResolverSession,
|
||||||
|
|
|
@ -42,6 +42,7 @@ import org.gcube.data.analysis.tabulardata.commons.utils.AuthorizationProvider;
|
||||||
import org.gcube.data.analysis.tabulardata.commons.utils.AuthorizationToken;
|
import org.gcube.data.analysis.tabulardata.commons.utils.AuthorizationToken;
|
||||||
import org.gcube.data.analysis.tabulardata.commons.utils.Licence;
|
import org.gcube.data.analysis.tabulardata.commons.utils.Licence;
|
||||||
import org.gcube.data.analysis.tabulardata.commons.webservice.types.TabularResourceType;
|
import org.gcube.data.analysis.tabulardata.commons.webservice.types.TabularResourceType;
|
||||||
|
import org.gcube.data.analysis.tabulardata.commons.webservice.types.TaskStatus;
|
||||||
import org.gcube.data.analysis.tabulardata.commons.webservice.types.TemplateDescription;
|
import org.gcube.data.analysis.tabulardata.commons.webservice.types.TemplateDescription;
|
||||||
import org.gcube.data.analysis.tabulardata.commons.webservice.types.operations.OperationDefinition;
|
import org.gcube.data.analysis.tabulardata.commons.webservice.types.operations.OperationDefinition;
|
||||||
import org.gcube.data.analysis.tabulardata.commons.webservice.types.operations.OperationExecution;
|
import org.gcube.data.analysis.tabulardata.commons.webservice.types.operations.OperationExecution;
|
||||||
|
@ -311,6 +312,57 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
return userInfo;
|
return userInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer pendingTasksRetrieve() throws TDGWTServiceException {
|
||||||
|
try {
|
||||||
|
|
||||||
|
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||||
|
ASLSession aslSession = SessionUtil.getAslSession(session);
|
||||||
|
logger.debug("pendingTasksRetrieve()");
|
||||||
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
|
TabularDataService service = TabularDataServiceFactory
|
||||||
|
.getService();
|
||||||
|
|
||||||
|
ArrayList<TabularResource> pendingTR=new ArrayList<TabularResource>();
|
||||||
|
List<TabularResource> trs=service.getTabularResources();
|
||||||
|
for(TabularResource tr:trs){
|
||||||
|
if(tr.isLocked()){
|
||||||
|
pendingTR.add(tr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Integer pendingNumber=0;
|
||||||
|
|
||||||
|
for(TabularResource tr:pendingTR){
|
||||||
|
logger.debug("Pending Task:"+ tr.getId());
|
||||||
|
List<Task> tasks=service.getTasks(tr.getId(), TaskStatus.IN_PROGRESS);
|
||||||
|
TRId trId=new TRId(String.valueOf(tr.getId().getValue()));
|
||||||
|
for(Task task:tasks){
|
||||||
|
TaskWrapper taskWrapper=new TaskWrapper(task,UIOperationsId.GenericPendingOperation, trId);
|
||||||
|
SessionUtil.setTaskInBackground(session, taskWrapper);
|
||||||
|
pendingNumber++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.debug("Pending number: "+pendingNumber);
|
||||||
|
return pendingNumber;
|
||||||
|
} catch (TDGWTServiceException e) {
|
||||||
|
throw e;
|
||||||
|
} catch (SecurityException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS);
|
||||||
|
} catch (Throwable e) {
|
||||||
|
logger.error("pendingTaskRetrieve(): " + e.getLocalizedMessage(), e);
|
||||||
|
throw new TDGWTServiceException("Error retrieving pending tasks: "
|
||||||
|
+ e.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
@ -906,14 +958,14 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
if (c.contains(ViewColumnMetadata.class)) {
|
if (c.contains(ViewColumnMetadata.class)) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ColumnData cData = new ColumnData();
|
ColumnData cData = new ColumnData();
|
||||||
cData.setId(Integer.toString(i));
|
cData.setId(Integer.toString(i));
|
||||||
cData.setColumnId(c.getLocalId().getValue());
|
cData.setColumnId(c.getLocalId().getValue());
|
||||||
cData.setName(c.getName());
|
cData.setName(c.getName());
|
||||||
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());
|
||||||
|
|
||||||
PeriodTypeMetadata periodTypeMetadata = null;
|
PeriodTypeMetadata periodTypeMetadata = null;
|
||||||
if (c.contains(PeriodTypeMetadata.class)) {
|
if (c.contains(PeriodTypeMetadata.class)) {
|
||||||
periodTypeMetadata = c
|
periodTypeMetadata = c
|
||||||
|
@ -922,12 +974,12 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
.getType();
|
.getType();
|
||||||
cData.setPeriodDataType(PeriodTypeMap
|
cData.setPeriodDataType(PeriodTypeMap
|
||||||
.map(periodType));
|
.map(periodType));
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnRelationship rel = c.getRelationship();
|
ColumnRelationship rel = c.getRelationship();
|
||||||
if (rel != null) {
|
if (rel != null) {
|
||||||
RelationshipData relData = retrieveRelationship(service,
|
RelationshipData relData = retrieveRelationship(
|
||||||
table, c, periodTypeMetadata, rel);
|
service, table, c, periodTypeMetadata, rel);
|
||||||
cData.setRelationship(relData);
|
cData.setRelationship(relData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -965,7 +1017,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
cData.setLocale(dataLocaleMetadata.getLocale());
|
cData.setLocale(dataLocaleMetadata.getLocale());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
cData.setTrId(trId);
|
cData.setTrId(trId);
|
||||||
columns.add(cData);
|
columns.add(cData);
|
||||||
i++;
|
i++;
|
||||||
|
@ -1030,7 +1081,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
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());
|
||||||
|
|
||||||
PeriodTypeMetadata periodTypeMetadata = null;
|
PeriodTypeMetadata periodTypeMetadata = null;
|
||||||
if (c.contains(PeriodTypeMetadata.class)) {
|
if (c.contains(PeriodTypeMetadata.class)) {
|
||||||
periodTypeMetadata = c
|
periodTypeMetadata = c
|
||||||
|
@ -1040,11 +1091,11 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
cData.setPeriodDataType(PeriodTypeMap
|
cData.setPeriodDataType(PeriodTypeMap
|
||||||
.map(periodType));
|
.map(periodType));
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnRelationship rel = c.getRelationship();
|
ColumnRelationship rel = c.getRelationship();
|
||||||
if (rel != null) {
|
if (rel != null) {
|
||||||
RelationshipData relData = retrieveRelationship(service,
|
RelationshipData relData = retrieveRelationship(
|
||||||
table, c, periodTypeMetadata, rel);
|
service, table, c, periodTypeMetadata, rel);
|
||||||
cData.setRelationship(relData);
|
cData.setRelationship(relData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1083,8 +1134,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
cData.setLocale(dataLocaleMetadata.getLocale());
|
cData.setLocale(dataLocaleMetadata.getLocale());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cData.setTrId(trId);
|
cData.setTrId(trId);
|
||||||
columns.add(cData);
|
columns.add(cData);
|
||||||
i++;
|
i++;
|
||||||
|
@ -1146,7 +1195,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
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());
|
||||||
|
|
||||||
PeriodTypeMetadata periodTypeMetadata = null;
|
PeriodTypeMetadata periodTypeMetadata = null;
|
||||||
if (c.contains(PeriodTypeMetadata.class)) {
|
if (c.contains(PeriodTypeMetadata.class)) {
|
||||||
periodTypeMetadata = c
|
periodTypeMetadata = c
|
||||||
|
@ -1154,11 +1203,11 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
PeriodType periodType = periodTypeMetadata.getType();
|
PeriodType periodType = periodTypeMetadata.getType();
|
||||||
cData.setPeriodDataType(PeriodTypeMap.map(periodType));
|
cData.setPeriodDataType(PeriodTypeMap.map(periodType));
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnRelationship rel = c.getRelationship();
|
ColumnRelationship rel = c.getRelationship();
|
||||||
if (rel != null) {
|
if (rel != null) {
|
||||||
RelationshipData relData = retrieveRelationship(service,
|
RelationshipData relData = retrieveRelationship(
|
||||||
table, c, periodTypeMetadata, rel);
|
service, table, c, periodTypeMetadata, rel);
|
||||||
cData.setRelationship(relData);
|
cData.setRelationship(relData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1197,10 +1246,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
cData.setLocale(dataLocaleMetadata.getLocale());
|
cData.setLocale(dataLocaleMetadata.getLocale());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (c.contains(ViewColumnMetadata.class)) {
|
if (c.contains(ViewColumnMetadata.class)) {
|
||||||
ColumnViewData columnViewData = retrieveColumnViewData(service, table, c,
|
ColumnViewData columnViewData = retrieveColumnViewData(
|
||||||
periodTypeMetadata);
|
service, table, c, periodTypeMetadata);
|
||||||
cData.setColumnViewData(columnViewData);
|
cData.setColumnViewData(columnViewData);
|
||||||
cData.setViewColumn(true);
|
cData.setViewColumn(true);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1270,7 +1318,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
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());
|
||||||
|
|
||||||
PeriodTypeMetadata periodTypeMetadata = null;
|
PeriodTypeMetadata periodTypeMetadata = null;
|
||||||
if (c.contains(PeriodTypeMetadata.class)) {
|
if (c.contains(PeriodTypeMetadata.class)) {
|
||||||
periodTypeMetadata = c
|
periodTypeMetadata = c
|
||||||
|
@ -1278,11 +1326,11 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
PeriodType periodType = periodTypeMetadata.getType();
|
PeriodType periodType = periodTypeMetadata.getType();
|
||||||
cData.setPeriodDataType(PeriodTypeMap.map(periodType));
|
cData.setPeriodDataType(PeriodTypeMap.map(periodType));
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnRelationship rel = c.getRelationship();
|
ColumnRelationship rel = c.getRelationship();
|
||||||
if (rel != null) {
|
if (rel != null) {
|
||||||
RelationshipData relData = retrieveRelationship(service,
|
RelationshipData relData = retrieveRelationship(
|
||||||
table, c, periodTypeMetadata, rel);
|
service, table, c, periodTypeMetadata, rel);
|
||||||
cData.setRelationship(relData);
|
cData.setRelationship(relData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1320,12 +1368,11 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
cData.setLocale(dataLocaleMetadata.getLocale());
|
cData.setLocale(dataLocaleMetadata.getLocale());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (c.contains(ViewColumnMetadata.class)) {
|
if (c.contains(ViewColumnMetadata.class)) {
|
||||||
ColumnViewData columnViewData = retrieveColumnViewData(service, table, c,
|
ColumnViewData columnViewData = retrieveColumnViewData(
|
||||||
periodTypeMetadata);
|
service, table, c, periodTypeMetadata);
|
||||||
cData.setColumnViewData(columnViewData);
|
cData.setColumnViewData(columnViewData);
|
||||||
cData.setViewColumn(true);
|
cData.setViewColumn(true);
|
||||||
} else {
|
} else {
|
||||||
cData.setViewColumn(false);
|
cData.setViewColumn(false);
|
||||||
}
|
}
|
||||||
|
@ -1391,19 +1438,18 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
Table timeTable = service
|
Table timeTable = service
|
||||||
.getTimeTable(periodTypeMetadata.getType());
|
.getTimeTable(periodTypeMetadata.getType());
|
||||||
if (timeTable == null || timeTable.getId() == null) {
|
if (timeTable == null || timeTable.getId() == null) {
|
||||||
throw new TDGWTServiceException(
|
throw new TDGWTServiceException("Error retrieving Time Table: "
|
||||||
"Error retrieving Time Table: " + table);
|
+ table);
|
||||||
}
|
}
|
||||||
logger.debug("Time Table Id: "+timeTable.getId());
|
logger.debug("Time Table Id: " + timeTable.getId());
|
||||||
Column timeColumn = timeTable
|
Column timeColumn = timeTable.getColumnByName(periodTypeMetadata
|
||||||
.getColumnByName(periodTypeMetadata.getType()
|
.getType().getName());
|
||||||
.getName());
|
relData = new RelationshipData(timeTable.getId().getValue(),
|
||||||
relData = new RelationshipData(timeTable.getId()
|
timeColumn.getLocalId().getValue());
|
||||||
.getValue(), timeColumn.getLocalId().getValue());
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
relData = new RelationshipData(rel.getTargetTableId()
|
relData = new RelationshipData(rel.getTargetTableId().getValue(),
|
||||||
.getValue(), rel.getTargetColumnId().getValue());
|
rel.getTargetColumnId().getValue());
|
||||||
}
|
}
|
||||||
return relData;
|
return relData;
|
||||||
}
|
}
|
||||||
|
@ -1413,66 +1459,63 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
throws TDGWTServiceException {
|
throws TDGWTServiceException {
|
||||||
ViewColumnMetadata viewMetadata = c
|
ViewColumnMetadata viewMetadata = c
|
||||||
.getMetadata(ViewColumnMetadata.class);
|
.getMetadata(ViewColumnMetadata.class);
|
||||||
logger.debug("ViewColumnMetadata: "
|
logger.debug("ViewColumnMetadata: " + viewMetadata.toString());
|
||||||
+ viewMetadata.toString());
|
|
||||||
|
ColumnViewData columnViewData = null;
|
||||||
ColumnViewData columnViewData=null;
|
|
||||||
Column sourceColumn = table.getColumnById(viewMetadata
|
Column sourceColumn = table.getColumnById(viewMetadata
|
||||||
.getSourceTableDimensionColumnId());
|
.getSourceTableDimensionColumnId());
|
||||||
if (sourceColumn.getColumnType().getCode()
|
if (sourceColumn.getColumnType().getCode()
|
||||||
.compareTo(ColumnTypeCode.TIMEDIMENSION.toString()) == 0) {
|
.compareTo(ColumnTypeCode.TIMEDIMENSION.toString()) == 0) {
|
||||||
|
|
||||||
PeriodTypeMetadata periodTypeMetadataSourceColumn = null;
|
PeriodTypeMetadata periodTypeMetadataSourceColumn = null;
|
||||||
if (sourceColumn.contains(PeriodTypeMetadata.class)) {
|
if (sourceColumn.contains(PeriodTypeMetadata.class)) {
|
||||||
periodTypeMetadataSourceColumn = sourceColumn
|
periodTypeMetadataSourceColumn = sourceColumn
|
||||||
.getMetadata(PeriodTypeMetadata.class);
|
.getMetadata(PeriodTypeMetadata.class);
|
||||||
|
|
||||||
Table timeTable = service
|
Table timeTable = service
|
||||||
.getTimeTable(periodTypeMetadataSourceColumn.getType());
|
.getTimeTable(periodTypeMetadataSourceColumn.getType());
|
||||||
|
|
||||||
if (timeTable == null || timeTable.getId() == null) {
|
if (timeTable == null || timeTable.getId() == null) {
|
||||||
throw new TDGWTServiceException(
|
throw new TDGWTServiceException(
|
||||||
"Error retrieving Time Table: " + table);
|
"Error retrieving Time Table: " + table);
|
||||||
}
|
}
|
||||||
logger.debug("Time Table Id: "+timeTable.getId());
|
logger.debug("Time Table Id: " + timeTable.getId());
|
||||||
|
|
||||||
Column timeColumn = timeTable
|
Column timeColumn = timeTable
|
||||||
.getColumnByName(periodTypeMetadataSourceColumn.getType()
|
.getColumnByName(periodTypeMetadataSourceColumn
|
||||||
.getName());
|
.getType().getName());
|
||||||
|
|
||||||
String sourceTableDimensionColumnId = viewMetadata
|
String sourceTableDimensionColumnId = viewMetadata
|
||||||
.getSourceTableDimensionColumnId().getValue();
|
.getSourceTableDimensionColumnId().getValue();
|
||||||
|
|
||||||
String targetTableColumnId = timeColumn.getLocalId().getValue();
|
String targetTableColumnId = timeColumn.getLocalId().getValue();
|
||||||
|
|
||||||
long targetTableId = timeTable.getId()
|
long targetTableId = timeTable.getId().getValue();
|
||||||
.getValue();
|
|
||||||
columnViewData = new ColumnViewData(
|
columnViewData = new ColumnViewData(
|
||||||
sourceTableDimensionColumnId,
|
sourceTableDimensionColumnId, targetTableColumnId,
|
||||||
targetTableColumnId, targetTableId);
|
targetTableId);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
logger.error("Error retrieving Time Table for view column:"+c+" , source column do not have a PeriodTypeMetadata: "+sourceColumn);
|
logger.error("Error retrieving Time Table for view column:" + c
|
||||||
|
+ " , source column do not have a PeriodTypeMetadata: "
|
||||||
|
+ sourceColumn);
|
||||||
throw new TDGWTServiceException(
|
throw new TDGWTServiceException(
|
||||||
"Error retrieving Time Table, source column do not have a PeriodTypeMetadata");
|
"Error retrieving Time Table, source column do not have a PeriodTypeMetadata");
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
String sourceTableDimensionColumnId = viewMetadata
|
String sourceTableDimensionColumnId = viewMetadata
|
||||||
.getSourceTableDimensionColumnId().getValue();
|
.getSourceTableDimensionColumnId().getValue();
|
||||||
|
|
||||||
String targetTableColumnId = viewMetadata
|
String targetTableColumnId = viewMetadata.getTargetTableColumnId()
|
||||||
.getTargetTableColumnId().getValue();
|
|
||||||
long targetTableId = viewMetadata.getTargetTableId()
|
|
||||||
.getValue();
|
.getValue();
|
||||||
columnViewData = new ColumnViewData(
|
long targetTableId = viewMetadata.getTargetTableId().getValue();
|
||||||
sourceTableDimensionColumnId,
|
columnViewData = new ColumnViewData(sourceTableDimensionColumnId,
|
||||||
targetTableColumnId, targetTableId);
|
targetTableColumnId, targetTableId);
|
||||||
}
|
}
|
||||||
return columnViewData;
|
return columnViewData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
@ -1508,9 +1551,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
cData.setPeriodDataType(PeriodTypeMap.map(periodType));
|
cData.setPeriodDataType(PeriodTypeMap.map(periodType));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c.contains(ViewColumnMetadata.class)) {
|
if (c.contains(ViewColumnMetadata.class)) {
|
||||||
ColumnViewData columnViewData = retrieveColumnViewData(service, table, c,
|
ColumnViewData columnViewData = retrieveColumnViewData(
|
||||||
periodTypeMetadata);
|
service, table, c, periodTypeMetadata);
|
||||||
cData.setColumnViewData(columnViewData);
|
cData.setColumnViewData(columnViewData);
|
||||||
cData.setViewColumn(true);
|
cData.setViewColumn(true);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1578,8 +1621,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
@ -1606,7 +1647,7 @@ 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());
|
||||||
|
|
||||||
PeriodTypeMetadata periodTypeMetadata = null;
|
PeriodTypeMetadata periodTypeMetadata = null;
|
||||||
if (c.contains(PeriodTypeMetadata.class)) {
|
if (c.contains(PeriodTypeMetadata.class)) {
|
||||||
periodTypeMetadata = c
|
periodTypeMetadata = c
|
||||||
|
@ -1614,10 +1655,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
PeriodType periodType = periodTypeMetadata.getType();
|
PeriodType periodType = periodTypeMetadata.getType();
|
||||||
cData.setPeriodDataType(PeriodTypeMap.map(periodType));
|
cData.setPeriodDataType(PeriodTypeMap.map(periodType));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c.contains(ViewColumnMetadata.class)) {
|
if (c.contains(ViewColumnMetadata.class)) {
|
||||||
ColumnViewData columnViewData = retrieveColumnViewData(service, table, c,
|
ColumnViewData columnViewData = retrieveColumnViewData(
|
||||||
periodTypeMetadata);
|
service, table, c, periodTypeMetadata);
|
||||||
cData.setColumnViewData(columnViewData);
|
cData.setColumnViewData(columnViewData);
|
||||||
cData.setViewColumn(true);
|
cData.setViewColumn(true);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1664,8 +1705,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
cData.setLocale(dataLocaleMetadata.getLocale());
|
cData.setLocale(dataLocaleMetadata.getLocale());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cData.setTrId(trId);
|
cData.setTrId(trId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1853,7 +1892,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
newTRId.setViewTable(false);
|
newTRId.setViewTable(false);
|
||||||
logger.debug("NewTRId: " + newTRId);
|
logger.debug("NewTRId: " + newTRId);
|
||||||
tData.setTrId(newTRId);
|
tData.setTrId(newTRId);
|
||||||
|
|
||||||
tData.setName(table.getName());
|
tData.setName(table.getName());
|
||||||
tData.setTypeName(table.getTableType().getName());
|
tData.setTypeName(table.getTableType().getName());
|
||||||
tData.setTypeCode(table.getTableType().getCode());
|
tData.setTypeCode(table.getTableType().getCode());
|
||||||
|
@ -1875,22 +1914,20 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
if (column.contains(PeriodTypeMetadata.class)) {
|
if (column.contains(PeriodTypeMetadata.class)) {
|
||||||
periodTypeMetadata = column
|
periodTypeMetadata = column
|
||||||
.getMetadata(PeriodTypeMetadata.class);
|
.getMetadata(PeriodTypeMetadata.class);
|
||||||
PeriodType periodType = periodTypeMetadata
|
PeriodType periodType = periodTypeMetadata.getType();
|
||||||
.getType();
|
colData.setPeriodDataType(PeriodTypeMap.map(periodType));
|
||||||
colData.setPeriodDataType(PeriodTypeMap
|
}
|
||||||
.map(periodType));
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnRelationship rel = column.getRelationship();
|
ColumnRelationship rel = column.getRelationship();
|
||||||
if (rel != null) {
|
if (rel != null) {
|
||||||
RelationshipData relData = retrieveRelationship(service,
|
RelationshipData relData = retrieveRelationship(
|
||||||
table, column, periodTypeMetadata, rel);
|
service, table, column, periodTypeMetadata, rel);
|
||||||
colData.setRelationship(relData);
|
colData.setRelationship(relData);
|
||||||
|
|
||||||
}
|
}
|
||||||
if (column.contains(ViewColumnMetadata.class)) {
|
if (column.contains(ViewColumnMetadata.class)) {
|
||||||
ColumnViewData columnViewData = retrieveColumnViewData(service, table, column,
|
ColumnViewData columnViewData = retrieveColumnViewData(
|
||||||
periodTypeMetadata);
|
service, table, column, periodTypeMetadata);
|
||||||
colData.setColumnViewData(columnViewData);
|
colData.setColumnViewData(columnViewData);
|
||||||
colData.setViewColumn(true);
|
colData.setViewColumn(true);
|
||||||
|
|
||||||
|
@ -1932,27 +1969,26 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
colData.setTypeCode(column.getColumnType().getCode());
|
colData.setTypeCode(column.getColumnType().getCode());
|
||||||
colData.setDataTypeName(column.getDataType().getName());
|
colData.setDataTypeName(column.getDataType().getName());
|
||||||
colData.setTrId(newTRId);
|
colData.setTrId(newTRId);
|
||||||
|
|
||||||
PeriodTypeMetadata periodTypeMetadata = null;
|
PeriodTypeMetadata periodTypeMetadata = null;
|
||||||
if (column.contains(PeriodTypeMetadata.class)) {
|
if (column.contains(PeriodTypeMetadata.class)) {
|
||||||
periodTypeMetadata = column
|
periodTypeMetadata = column
|
||||||
.getMetadata(PeriodTypeMetadata.class);
|
.getMetadata(PeriodTypeMetadata.class);
|
||||||
PeriodType periodType = periodTypeMetadata
|
PeriodType periodType = periodTypeMetadata.getType();
|
||||||
.getType();
|
colData.setPeriodDataType(PeriodTypeMap.map(periodType));
|
||||||
colData.setPeriodDataType(PeriodTypeMap
|
}
|
||||||
.map(periodType));
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnRelationship rel = column.getRelationship();
|
ColumnRelationship rel = column.getRelationship();
|
||||||
if (rel != null) {
|
if (rel != null) {
|
||||||
RelationshipData relData = retrieveRelationship(service,
|
RelationshipData relData = retrieveRelationship(
|
||||||
viewTable, column, periodTypeMetadata, rel);
|
service, viewTable, column, periodTypeMetadata,
|
||||||
|
rel);
|
||||||
colData.setRelationship(relData);
|
colData.setRelationship(relData);
|
||||||
|
|
||||||
}
|
}
|
||||||
if (column.contains(ViewColumnMetadata.class)) {
|
if (column.contains(ViewColumnMetadata.class)) {
|
||||||
ColumnViewData columnViewData = retrieveColumnViewData(service, viewTable, column,
|
ColumnViewData columnViewData = retrieveColumnViewData(
|
||||||
periodTypeMetadata);
|
service, viewTable, column, periodTypeMetadata);
|
||||||
colData.setColumnViewData(columnViewData);
|
colData.setColumnViewData(columnViewData);
|
||||||
colData.setViewColumn(true);
|
colData.setViewColumn(true);
|
||||||
|
|
||||||
|
@ -2042,28 +2078,25 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
colData.setTypeCode(column.getColumnType().getCode());
|
colData.setTypeCode(column.getColumnType().getCode());
|
||||||
colData.setDataTypeName(column.getDataType().getName());
|
colData.setDataTypeName(column.getDataType().getName());
|
||||||
colData.setTrId(newTRId);
|
colData.setTrId(newTRId);
|
||||||
|
|
||||||
PeriodTypeMetadata periodTypeMetadata = null;
|
PeriodTypeMetadata periodTypeMetadata = null;
|
||||||
if (column.contains(PeriodTypeMetadata.class)) {
|
if (column.contains(PeriodTypeMetadata.class)) {
|
||||||
periodTypeMetadata = column
|
periodTypeMetadata = column
|
||||||
.getMetadata(PeriodTypeMetadata.class);
|
.getMetadata(PeriodTypeMetadata.class);
|
||||||
PeriodType periodType = periodTypeMetadata
|
PeriodType periodType = periodTypeMetadata.getType();
|
||||||
.getType();
|
colData.setPeriodDataType(PeriodTypeMap.map(periodType));
|
||||||
colData.setPeriodDataType(PeriodTypeMap
|
}
|
||||||
.map(periodType));
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnRelationship rel = column.getRelationship();
|
ColumnRelationship rel = column.getRelationship();
|
||||||
if (rel != null) {
|
if (rel != null) {
|
||||||
RelationshipData relData = retrieveRelationship(service,
|
RelationshipData relData = retrieveRelationship(
|
||||||
table, column, periodTypeMetadata, rel);
|
service, table, column, periodTypeMetadata, rel);
|
||||||
colData.setRelationship(relData);
|
colData.setRelationship(relData);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if (column.contains(ViewColumnMetadata.class)) {
|
if (column.contains(ViewColumnMetadata.class)) {
|
||||||
ColumnViewData columnViewData = retrieveColumnViewData(service, table, column,
|
ColumnViewData columnViewData = retrieveColumnViewData(
|
||||||
periodTypeMetadata);
|
service, table, column, periodTypeMetadata);
|
||||||
colData.setColumnViewData(columnViewData);
|
colData.setColumnViewData(columnViewData);
|
||||||
colData.setViewColumn(true);
|
colData.setViewColumn(true);
|
||||||
|
|
||||||
|
@ -2105,27 +2138,26 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
colData.setTypeCode(column.getColumnType().getCode());
|
colData.setTypeCode(column.getColumnType().getCode());
|
||||||
colData.setDataTypeName(column.getDataType().getName());
|
colData.setDataTypeName(column.getDataType().getName());
|
||||||
colData.setTrId(newTRId);
|
colData.setTrId(newTRId);
|
||||||
|
|
||||||
PeriodTypeMetadata periodTypeMetadata = null;
|
PeriodTypeMetadata periodTypeMetadata = null;
|
||||||
if (column.contains(PeriodTypeMetadata.class)) {
|
if (column.contains(PeriodTypeMetadata.class)) {
|
||||||
periodTypeMetadata = column
|
periodTypeMetadata = column
|
||||||
.getMetadata(PeriodTypeMetadata.class);
|
.getMetadata(PeriodTypeMetadata.class);
|
||||||
PeriodType periodType = periodTypeMetadata
|
PeriodType periodType = periodTypeMetadata.getType();
|
||||||
.getType();
|
colData.setPeriodDataType(PeriodTypeMap.map(periodType));
|
||||||
colData.setPeriodDataType(PeriodTypeMap
|
}
|
||||||
.map(periodType));
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnRelationship rel = column.getRelationship();
|
ColumnRelationship rel = column.getRelationship();
|
||||||
if (rel != null) {
|
if (rel != null) {
|
||||||
RelationshipData relData = retrieveRelationship(service,
|
RelationshipData relData = retrieveRelationship(
|
||||||
viewTable, column, periodTypeMetadata, rel);
|
service, viewTable, column, periodTypeMetadata,
|
||||||
|
rel);
|
||||||
colData.setRelationship(relData);
|
colData.setRelationship(relData);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (column.contains(ViewColumnMetadata.class)) {
|
if (column.contains(ViewColumnMetadata.class)) {
|
||||||
ColumnViewData columnViewData = retrieveColumnViewData(service, viewTable, column,
|
ColumnViewData columnViewData = retrieveColumnViewData(
|
||||||
periodTypeMetadata);
|
service, viewTable, column, periodTypeMetadata);
|
||||||
colData.setColumnViewData(columnViewData);
|
colData.setColumnViewData(columnViewData);
|
||||||
colData.setViewColumn(true);
|
colData.setViewColumn(true);
|
||||||
|
|
||||||
|
@ -2260,12 +2292,12 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
* @param tr
|
* @param tr
|
||||||
* @throws TDGWTServiceException
|
* @throws TDGWTServiceException
|
||||||
*
|
*
|
||||||
private TabResource retrieveTRMetadataFromServiceAndLastTable(
|
* private TabResource
|
||||||
TabularDataService service, TabularResource tr)
|
* retrieveTRMetadataFromServiceAndLastTable( TabularDataService
|
||||||
throws TDGWTServiceException {
|
* service, TabularResource tr) throws TDGWTServiceException {
|
||||||
return retrieveTRMetadataFromServiceAndLastTable(service, tr, 0);
|
* return retrieveTRMetadataFromServiceAndLastTable(service, tr,
|
||||||
}
|
* 0); }
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the informations for a specific Tabular Resource from service
|
* Retrieves the informations for a specific Tabular Resource from service
|
||||||
|
@ -2664,9 +2696,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ArrayList<TabResource> OrderPagingRow(
|
private ArrayList<TabResource> OrderPagingRow(CodelistPagingLoadConfig plc,
|
||||||
CodelistPagingLoadConfig plc, ArrayList<TabResource> ltrCopy,
|
ArrayList<TabResource> ltrCopy, HttpSession session) {
|
||||||
HttpSession session) {
|
|
||||||
|
|
||||||
ArrayList<OrderInfo> orders = plc.getListOrderInfo();
|
ArrayList<OrderInfo> orders = plc.getListOrderInfo();
|
||||||
for (OrderInfo order : orders) {
|
for (OrderInfo order : orders) {
|
||||||
|
@ -2989,9 +3020,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
@ -3477,8 +3505,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
* @param csvImportSession
|
* @param csvImportSession
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Map<String, Object> csvImportFileParameter(
|
private Map<String, Object> csvImportFileParameter(String fileUrlOnStorage,
|
||||||
String fileUrlOnStorage, CSVFileUploadSession fileUploadSession,
|
CSVFileUploadSession fileUploadSession,
|
||||||
CSVImportSession csvImportSession) {
|
CSVImportSession csvImportSession) {
|
||||||
Map<String, Object> parameterInstances = new HashMap<String, Object>();
|
Map<String, Object> parameterInstances = new HashMap<String, Object>();
|
||||||
parameterInstances.put(Constants.PARAMETER_URL, fileUrlOnStorage);
|
parameterInstances.put(Constants.PARAMETER_URL, fileUrlOnStorage);
|
||||||
|
@ -5165,8 +5193,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
cData.setLocale(dataLocaleMetadata.getLocale());
|
cData.setLocale(dataLocaleMetadata.getLocale());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cData.setTrId(trId);
|
cData.setTrId(trId);
|
||||||
columns.add(cData);
|
columns.add(cData);
|
||||||
i++;
|
i++;
|
||||||
|
|
Loading…
Reference in New Issue