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);
|
comboAttributeType.setTriggerAction(TriggerAction.ALL);
|
||||||
|
|
||||||
if (initialRuleDescriptionData != null) {
|
if (initialRuleDescriptionData != null) {
|
||||||
|
Log.debug("Initial RuleDescriptionData: "+initialRuleDescriptionData);
|
||||||
ColumnDataType cdt = retrieveColumnDataType();
|
ColumnDataType cdt = retrieveColumnDataType();
|
||||||
if (cdt != null) {
|
if (cdt != null) {
|
||||||
|
Log.debug("Retrieved column data type: "+cdt);
|
||||||
ColumnDataTypeElement cdte = ColumnDataTypeStore
|
ColumnDataTypeElement cdte = ColumnDataTypeStore
|
||||||
.selectedAttributeElement(cdt);
|
.selectedAttributeElement(cdt);
|
||||||
if (cdte != null) {
|
if (cdte != null) {
|
||||||
comboAttributeType.setValue(cdte);
|
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.eventBus = eventBus;
|
||||||
this.trId=trId;
|
this.trId=trId;
|
||||||
column = new ColumnData();
|
column = new ColumnData();
|
||||||
|
column.setId(columnMockUp.getId());
|
||||||
column.setColumnId(columnMockUp.getColumnId());
|
column.setColumnId(columnMockUp.getColumnId());
|
||||||
column.setLabel(columnMockUp.getLabel());
|
column.setLabel(columnMockUp.getLabel());
|
||||||
column.setDataTypeName(columnMockUp.getColumnDataType().toString());
|
column.setDataTypeName(columnMockUp.getColumnDataType().toString());
|
||||||
|
@ -112,19 +113,25 @@ public class ReplaceExpressionDialog extends Window implements
|
||||||
listeners=new ArrayList<ExpressionWrapperNotificationListener>();
|
listeners=new ArrayList<ExpressionWrapperNotificationListener>();
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
column = new ColumnData();
|
column = new ColumnData();
|
||||||
|
column.setId(columnMockUp.getId());
|
||||||
column.setColumnId(columnMockUp.getColumnId());
|
column.setColumnId(columnMockUp.getColumnId());
|
||||||
column.setLabel(columnMockUp.getLabel());
|
column.setLabel(columnMockUp.getLabel());
|
||||||
column.setDataTypeName(columnMockUp.getColumnDataType().toString());
|
column.setDataTypeName(columnMockUp.getColumnDataType().toString());
|
||||||
column.setTypeCode(columnMockUp.getColumnType().toString());
|
column.setTypeCode(columnMockUp.getColumnType().toString());
|
||||||
|
Log.debug("ReplaceExpressionDialog: Column: "+column);
|
||||||
|
|
||||||
columns=new ArrayList<ColumnData>();
|
columns=new ArrayList<ColumnData>();
|
||||||
|
Log.debug("ReplaceExpressionDialog Columns:");
|
||||||
for(ColumnMockUp colMock:columnMockUpList){
|
for(ColumnMockUp colMock:columnMockUpList){
|
||||||
ColumnData col = new ColumnData();
|
ColumnData col = new ColumnData();
|
||||||
|
col.setId(colMock.getId());
|
||||||
col.setColumnId(colMock.getColumnId());
|
col.setColumnId(colMock.getColumnId());
|
||||||
col.setLabel(colMock.getLabel());
|
col.setLabel(colMock.getLabel());
|
||||||
col.setDataTypeName(colMock.getColumnDataType().toString());
|
col.setDataTypeName(colMock.getColumnDataType().toString());
|
||||||
col.setTypeCode(colMock.getColumnType().toString());
|
col.setTypeCode(colMock.getColumnType().toString());
|
||||||
|
Log.debug("Columns: "+col);
|
||||||
columns.add(col);
|
columns.add(col);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type = ReplaceExpressionType.Template;
|
type = ReplaceExpressionType.Template;
|
||||||
|
|
|
@ -305,6 +305,7 @@ public class ExpressionServiceImpl extends TDGWTServiceImpl implements
|
||||||
ruleDescription.getOwner(),
|
ruleDescription.getOwner(),
|
||||||
RuleScopeMap.map(ruleDescription.getScope()),
|
RuleScopeMap.map(ruleDescription.getScope()),
|
||||||
tdRuleColumnType, cexp);
|
tdRuleColumnType, cexp);
|
||||||
|
logger.info("Rule: "+ruleData);
|
||||||
rulesDes.add(ruleData);
|
rulesDes.add(ruleData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -357,7 +358,12 @@ public class ExpressionServiceImpl extends TDGWTServiceImpl implements
|
||||||
|
|
||||||
List<RuleDescription> rules = service
|
List<RuleDescription> rules = service
|
||||||
.getApplicableBaseColumnRules(dataType);
|
.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>();
|
ArrayList<RuleDescriptionData> rulesDes = new ArrayList<RuleDescriptionData>();
|
||||||
|
|
||||||
C_ExpressionParser parser = new C_ExpressionParser();
|
C_ExpressionParser parser = new C_ExpressionParser();
|
||||||
|
@ -374,6 +380,7 @@ public class ExpressionServiceImpl extends TDGWTServiceImpl implements
|
||||||
RuleScopeMap.map(ruleDescription.getScope()),
|
RuleScopeMap.map(ruleDescription.getScope()),
|
||||||
tdRuleColumnType, cexp);
|
tdRuleColumnType, cexp);
|
||||||
rulesDes.add(ruleData);
|
rulesDes.add(ruleData);
|
||||||
|
logger.info("Rule:"+ruleData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -387,7 +394,7 @@ public class ExpressionServiceImpl extends TDGWTServiceImpl implements
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw e;
|
throw e;
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
logger.error("Error in getRule(): " + e.getLocalizedMessage());
|
logger.error("Error in getApplicableBaseColumnRules(): " + e.getLocalizedMessage());
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new TDGWTServiceException("Error retrieving the rules: "
|
throw new TDGWTServiceException("Error retrieving the rules: "
|
||||||
+ e.getLocalizedMessage());
|
+ e.getLocalizedMessage());
|
||||||
|
@ -428,6 +435,10 @@ public class ExpressionServiceImpl extends TDGWTServiceImpl implements
|
||||||
|
|
||||||
RuleColumnType ruleColumnType = RuleColumnTypeMap
|
RuleColumnType ruleColumnType = RuleColumnTypeMap
|
||||||
.map(ruleDescriptionData.getTdRuleColumnType());
|
.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(
|
RuleId ruleId = service.saveColumnRule(
|
||||||
ruleDescriptionData.getName(),
|
ruleDescriptionData.getName(),
|
||||||
|
|
Loading…
Reference in New Issue