Fixed Replace For Template
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@114258 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
b23cce03ba
commit
31cac58553
|
@ -374,14 +374,18 @@ public class ColumnExpressionPanel extends FramedPanel {
|
|||
comboAttributeType.setTriggerAction(TriggerAction.ALL);
|
||||
|
||||
if (initialRuleDescriptionData != null) {
|
||||
Log.debug("Initial RuleDescriptionData: "+initialRuleDescriptionData);
|
||||
ColumnDataType cdt = retrieveColumnDataType();
|
||||
if (cdt != null) {
|
||||
Log.debug("Retrieved column data type: "+cdt);
|
||||
ColumnDataTypeElement cdte = ColumnDataTypeStore
|
||||
.selectedAttributeElement(cdt);
|
||||
if (cdte != null) {
|
||||
comboAttributeType.setValue(cdte);
|
||||
|
||||
}
|
||||
} else {
|
||||
Log.debug("Retrieved column data type null");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -86,6 +86,7 @@ public class ReplaceExpressionDialog extends Window implements
|
|||
this.eventBus = eventBus;
|
||||
this.trId=trId;
|
||||
column = new ColumnData();
|
||||
column.setId(columnMockUp.getId());
|
||||
column.setColumnId(columnMockUp.getColumnId());
|
||||
column.setLabel(columnMockUp.getLabel());
|
||||
column.setDataTypeName(columnMockUp.getColumnDataType().toString());
|
||||
|
@ -112,19 +113,25 @@ public class ReplaceExpressionDialog extends Window implements
|
|||
listeners=new ArrayList<ExpressionWrapperNotificationListener>();
|
||||
this.eventBus = eventBus;
|
||||
column = new ColumnData();
|
||||
column.setId(columnMockUp.getId());
|
||||
column.setColumnId(columnMockUp.getColumnId());
|
||||
column.setLabel(columnMockUp.getLabel());
|
||||
column.setDataTypeName(columnMockUp.getColumnDataType().toString());
|
||||
column.setTypeCode(columnMockUp.getColumnType().toString());
|
||||
Log.debug("ReplaceExpressionDialog: Column: "+column);
|
||||
|
||||
columns=new ArrayList<ColumnData>();
|
||||
Log.debug("ReplaceExpressionDialog Columns:");
|
||||
for(ColumnMockUp colMock:columnMockUpList){
|
||||
ColumnData col = new ColumnData();
|
||||
col.setId(colMock.getId());
|
||||
col.setColumnId(colMock.getColumnId());
|
||||
col.setLabel(colMock.getLabel());
|
||||
col.setDataTypeName(colMock.getColumnDataType().toString());
|
||||
col.setTypeCode(colMock.getColumnType().toString());
|
||||
Log.debug("Columns: "+col);
|
||||
columns.add(col);
|
||||
|
||||
}
|
||||
|
||||
type = ReplaceExpressionType.Template;
|
||||
|
|
|
@ -290,7 +290,7 @@ public class ReplaceWidget extends SimpleContainer {
|
|||
propsColumnData.id());
|
||||
Log.debug("Store Columns: " + storeColumns);
|
||||
storeColumns.addAll(columns);
|
||||
|
||||
|
||||
final ComboBox<ColumnData> comboColumns = new ComboBox<ColumnData>(
|
||||
storeColumns, propsColumnData.label());
|
||||
|
||||
|
|
|
@ -305,6 +305,7 @@ public class ExpressionServiceImpl extends TDGWTServiceImpl implements
|
|||
ruleDescription.getOwner(),
|
||||
RuleScopeMap.map(ruleDescription.getScope()),
|
||||
tdRuleColumnType, cexp);
|
||||
logger.info("Rule: "+ruleData);
|
||||
rulesDes.add(ruleData);
|
||||
|
||||
}
|
||||
|
@ -357,7 +358,12 @@ public class ExpressionServiceImpl extends TDGWTServiceImpl implements
|
|||
|
||||
List<RuleDescription> rules = service
|
||||
.getApplicableBaseColumnRules(dataType);
|
||||
|
||||
if(rules==null){
|
||||
logger.error("Invalid applicable base column rules from service: null");
|
||||
throw new TDGWTServiceException("Error retrieving the rules: invalid applicable base column rules from service(null)");
|
||||
} else {
|
||||
logger.debug("Applicable Base Column Rules: "+rules.size());
|
||||
}
|
||||
ArrayList<RuleDescriptionData> rulesDes = new ArrayList<RuleDescriptionData>();
|
||||
|
||||
C_ExpressionParser parser = new C_ExpressionParser();
|
||||
|
@ -374,6 +380,7 @@ public class ExpressionServiceImpl extends TDGWTServiceImpl implements
|
|||
RuleScopeMap.map(ruleDescription.getScope()),
|
||||
tdRuleColumnType, cexp);
|
||||
rulesDes.add(ruleData);
|
||||
logger.info("Rule:"+ruleData);
|
||||
|
||||
}
|
||||
|
||||
|
@ -387,7 +394,7 @@ public class ExpressionServiceImpl extends TDGWTServiceImpl implements
|
|||
e.printStackTrace();
|
||||
throw e;
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error in getRule(): " + e.getLocalizedMessage());
|
||||
logger.error("Error in getApplicableBaseColumnRules(): " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
throw new TDGWTServiceException("Error retrieving the rules: "
|
||||
+ e.getLocalizedMessage());
|
||||
|
@ -428,7 +435,11 @@ public class ExpressionServiceImpl extends TDGWTServiceImpl implements
|
|||
|
||||
RuleColumnType ruleColumnType = RuleColumnTypeMap
|
||||
.map(ruleDescriptionData.getTdRuleColumnType());
|
||||
|
||||
if(ruleColumnType==null){
|
||||
logger.debug("Error saving rule: rule column type is null!");
|
||||
throw new TDGWTServiceException("Error saving rule: rule column type is null!");
|
||||
}
|
||||
|
||||
RuleId ruleId = service.saveColumnRule(
|
||||
ruleDescriptionData.getName(),
|
||||
ruleDescriptionData.getDescription(), conditionExpression,
|
||||
|
|
Loading…
Reference in New Issue