Updated Column selection
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@113810 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
d65634135a
commit
adf762d5ad
|
@ -334,8 +334,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
* URL.setURLStreamHandlerFactory(confStreamHandlerFactory);
|
||||
* logger.debug("Activated SMP Handler");
|
||||
*/
|
||||
/*Properties props = System.getProperties();
|
||||
logger.debug("System Properties: " + props);*/
|
||||
/*
|
||||
* Properties props = System.getProperties();
|
||||
* logger.debug("System Properties: " + props);
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
@ -345,13 +347,27 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
*/
|
||||
@Override
|
||||
public UserInfo hello() throws TDGWTServiceException {
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
ASLSession aslSession = SessionUtil.getAslSession(session);
|
||||
UserInfo userInfo = new UserInfo(aslSession.getUsername(),
|
||||
aslSession.getGroupId(), aslSession.getGroupName(),
|
||||
aslSession.getScope(), aslSession.getScopeName(),
|
||||
aslSession.getUserEmailAddress(), aslSession.getUserFullName());
|
||||
return userInfo;
|
||||
try {
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
ASLSession aslSession = SessionUtil.getAslSession(session);
|
||||
UserInfo userInfo = new UserInfo(aslSession.getUsername(),
|
||||
aslSession.getGroupId(), aslSession.getGroupName(),
|
||||
aslSession.getScope(), aslSession.getScopeName(),
|
||||
aslSession.getUserEmailAddress(),
|
||||
aslSession.getUserFullName());
|
||||
return userInfo;
|
||||
} catch (TDGWTServiceException e) {
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
} catch (SecurityException e) {
|
||||
e.printStackTrace();
|
||||
throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS);
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
logger.error("Hello(): " + e.getLocalizedMessage(), e);
|
||||
throw new TDGWTServiceException(e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1344,7 +1360,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
aslSession.getUsername(), aslSession.getScope()));
|
||||
TabularDataService service = TabularDataServiceFactory.getService();
|
||||
|
||||
logger.debug("getColumns():" + trId.toString());
|
||||
logger.debug("getColumns():" + trId);
|
||||
|
||||
Table table = service.getTable(new TableId(Long.valueOf(trId
|
||||
.getTableId())));
|
||||
|
@ -1565,8 +1581,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
+ e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns ArrayList<ColumnData> other than IdColumnType,
|
||||
* ValidationColumnType, DimensionColumnType and TimeDimensionColumnType
|
||||
|
@ -1574,7 +1589,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
*
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
||||
|
||||
@Override
|
||||
public ArrayList<ColumnData> getColumnWithOnlyViewColumnInRel(TRId trId)
|
||||
throws TDGWTServiceException {
|
||||
|
@ -1593,8 +1608,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
ArrayList<ColumnData> columns = new ArrayList<ColumnData>();
|
||||
ArrayList<ColumnData> dimensions = new ArrayList<ColumnData>();
|
||||
|
||||
|
||||
|
||||
List<Column> cols = table.getColumns();
|
||||
int i = 0;
|
||||
for (Column c : cols) {
|
||||
|
@ -1609,9 +1623,7 @@ 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
|
||||
|
@ -1670,46 +1682,49 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
} else {
|
||||
cData.setViewColumn(false);
|
||||
}
|
||||
|
||||
|
||||
cData.setTrId(trId);
|
||||
|
||||
if(cData.getTypeCode().compareTo(ColumnTypeCode.DIMENSION.toString())==0
|
||||
|| cData.getTypeCode().compareTo(ColumnTypeCode.TIMEDIMENSION.toString())==0){
|
||||
|
||||
if (cData.getTypeCode().compareTo(
|
||||
ColumnTypeCode.DIMENSION.toString()) == 0
|
||||
|| cData.getTypeCode().compareTo(
|
||||
ColumnTypeCode.TIMEDIMENSION.toString()) == 0) {
|
||||
dimensions.add(cData);
|
||||
}
|
||||
|
||||
|
||||
columns.add(cData);
|
||||
i++;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
ArrayList<ColumnData> removable = new ArrayList<ColumnData>();
|
||||
for (int k = 0; k < columns.size(); k++) {
|
||||
ColumnData col=columns.get(k);
|
||||
if (col.getColumnId() != null
|
||||
&& col.isViewColumn()){
|
||||
ColumnViewData colViewData=col.getColumnViewData();
|
||||
String sourceTableDimensionColumnId=colViewData.getSourceTableDimensionColumnId();
|
||||
|
||||
ColumnData col = columns.get(k);
|
||||
if (col.getColumnId() != null && col.isViewColumn()) {
|
||||
ColumnViewData colViewData = col.getColumnViewData();
|
||||
String sourceTableDimensionColumnId = colViewData
|
||||
.getSourceTableDimensionColumnId();
|
||||
|
||||
for (int j = 0; j < dimensions.size(); j++) {
|
||||
ColumnData dim=dimensions.get(j);
|
||||
if(dim.getColumnId().compareTo(sourceTableDimensionColumnId)==0){
|
||||
ColumnData dim = dimensions.get(j);
|
||||
if (dim.getColumnId().compareTo(
|
||||
sourceTableDimensionColumnId) == 0) {
|
||||
RelationshipData rel = dim.getRelationship();
|
||||
if(rel!=null){
|
||||
if (rel != null) {
|
||||
String cId = rel.getTargetColumnId();
|
||||
if(cId==null || cId.compareTo(col.getColumnId())!=0){
|
||||
if (cId == null
|
||||
|| cId.compareTo(col.getColumnId()) != 0) {
|
||||
removable.add(col);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
removable.add(col);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
columns.removeAll(removable);
|
||||
columns.removeAll(dimensions);
|
||||
|
@ -1727,7 +1742,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
+ e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns ArrayList<ColumnData> other than IdColumnType,
|
||||
|
|
|
@ -12,7 +12,7 @@ package org.gcube.portlets.user.td.gwtservice.shared;
|
|||
*/
|
||||
public class Constants {
|
||||
|
||||
public final static String VERSION = "2.4.0";
|
||||
public final static String VERSION = "2.6.0";
|
||||
public final static String DEFAULT_USER = "test.user";
|
||||
public final static String DEFAULT_SCOPE = "/gcube/devsec/devVRE";
|
||||
|
||||
|
|
|
@ -32,6 +32,35 @@ public class ColumnMockUp implements Serializable {
|
|||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ColumnMockUp
|
||||
*
|
||||
*
|
||||
* @param id
|
||||
* @param columnId
|
||||
* @param columnType
|
||||
* @param columnDataType
|
||||
* @param label
|
||||
*/
|
||||
public ColumnMockUp(String id, String columnId, ColumnTypeCode columnType,
|
||||
ColumnDataType columnDataType, String label) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.columnId = columnId;
|
||||
this.columnType = columnType;
|
||||
this.columnDataType = columnDataType;
|
||||
this.defaultValue = null;
|
||||
this.label = label;
|
||||
this.localeName = null;
|
||||
this.hasExpression = false;
|
||||
this.expression = null;
|
||||
this.timeDimensionType = null;
|
||||
this.codelistColumnReference = null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* For Code, CodeDescription and Annotation Column
|
||||
* @param id TODO
|
||||
|
|
Loading…
Reference in New Issue