diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ColumnExpressionPanel.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ColumnExpressionPanel.java index 34f3bb7..ac3e8ec 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ColumnExpressionPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ColumnExpressionPanel.java @@ -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"); } } diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ReplaceExpressionDialog.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ReplaceExpressionDialog.java index 49183a5..f7688b1 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ReplaceExpressionDialog.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/ReplaceExpressionDialog.java @@ -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(); 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(); + 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; diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/expression/ReplaceWidget.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/expression/ReplaceWidget.java index 8521c46..4efb768 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/expression/ReplaceWidget.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/expression/ReplaceWidget.java @@ -290,7 +290,7 @@ public class ReplaceWidget extends SimpleContainer { propsColumnData.id()); Log.debug("Store Columns: " + storeColumns); storeColumns.addAll(columns); - + final ComboBox comboColumns = new ComboBox( storeColumns, propsColumnData.label()); diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/server/ExpressionServiceImpl.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/server/ExpressionServiceImpl.java index dd7a668..bbca014 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/server/ExpressionServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/server/ExpressionServiceImpl.java @@ -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 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 rulesDes = new ArrayList(); 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,