Updated AddColumn

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@113837 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-03-31 16:06:05 +00:00
parent b39e9db430
commit 0143f32efa
10 changed files with 189 additions and 99 deletions

View File

@ -4,7 +4,7 @@ import java.util.ArrayList;
import org.gcube.portlets.user.td.expressionwidget.client.resources.ExpressionResources; import org.gcube.portlets.user.td.expressionwidget.client.resources.ExpressionResources;
import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionServiceAsync; import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionServiceAsync;
import org.gcube.portlets.user.td.expressionwidget.client.type.ReplaceColumnByExpressionType; import org.gcube.portlets.user.td.expressionwidget.client.type.ReplaceExpressionType;
import org.gcube.portlets.user.td.expressionwidget.client.utils.UtilsGXT3; import org.gcube.portlets.user.td.expressionwidget.client.utils.UtilsGXT3;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync; import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsFinalException; import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsFinalException;
@ -50,7 +50,7 @@ public class ReplaceColumnByExpressionDialog extends Window implements
private ArrayList<ColumnData> columns; private ArrayList<ColumnData> columns;
private EventBus eventBus; private EventBus eventBus;
private ReplaceColumnByExpressionType replaceColumnByExpressionType; private ReplaceExpressionType replaceExpressionType;
// private String columnLocalId; // private String columnLocalId;
private TRId trId; private TRId trId;
@ -82,7 +82,7 @@ public class ReplaceColumnByExpressionDialog extends Window implements
columns.add(col); columns.add(col);
} }
replaceColumnByExpressionType = ReplaceColumnByExpressionType.Template; replaceExpressionType = ReplaceExpressionType.Template;
initWindow(); initWindow();
sanitizesColumns(); sanitizesColumns();
create(); create();
@ -101,7 +101,7 @@ public class ReplaceColumnByExpressionDialog extends Window implements
this.trId = trId; this.trId = trId;
column = new ColumnData(); column = new ColumnData();
column.setColumnId(columnId); column.setColumnId(columnId);
replaceColumnByExpressionType = ReplaceColumnByExpressionType.Replace; replaceExpressionType = ReplaceExpressionType.Replace;
initWindow(); initWindow();
load(); load();
@ -137,7 +137,7 @@ public class ReplaceColumnByExpressionDialog extends Window implements
protected void create() { protected void create() {
replaceColumnByExpressionPanel = new ReplaceColumnByExpressionPanel( replaceColumnByExpressionPanel = new ReplaceColumnByExpressionPanel(
this, column, columns, eventBus, replaceColumnByExpressionType); this, column, columns, eventBus, replaceExpressionType);
add(replaceColumnByExpressionPanel); add(replaceColumnByExpressionPanel);
} }

View File

@ -5,7 +5,7 @@ import java.util.Date;
import org.gcube.portlets.user.td.expressionwidget.client.properties.ColumnDataPropertiesCombo; import org.gcube.portlets.user.td.expressionwidget.client.properties.ColumnDataPropertiesCombo;
import org.gcube.portlets.user.td.expressionwidget.client.resources.ExpressionResources; import org.gcube.portlets.user.td.expressionwidget.client.resources.ExpressionResources;
import org.gcube.portlets.user.td.expressionwidget.client.type.ReplaceColumnByExpressionType; import org.gcube.portlets.user.td.expressionwidget.client.type.ReplaceExpressionType;
import org.gcube.portlets.user.td.expressionwidget.shared.exception.ConditionTypeMapException; import org.gcube.portlets.user.td.expressionwidget.shared.exception.ConditionTypeMapException;
import org.gcube.portlets.user.td.expressionwidget.shared.exception.ReplaceTypeMapException; import org.gcube.portlets.user.td.expressionwidget.shared.exception.ReplaceTypeMapException;
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData; import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
@ -86,7 +86,7 @@ public class ReplaceColumnByExpressionPanel extends FramedPanel {
private ColumnData column; private ColumnData column;
private ArrayList<ColumnData> columns; private ArrayList<ColumnData> columns;
private ReplaceColumnByExpressionType replaceColumnByExpressionType; private ReplaceExpressionType replaceExpressionType;
private DateTimeFormat sdf = DateTimeFormat.getFormat("yyyy-MM-dd"); private DateTimeFormat sdf = DateTimeFormat.getFormat("yyyy-MM-dd");
@ -111,13 +111,13 @@ public class ReplaceColumnByExpressionPanel extends FramedPanel {
public ReplaceColumnByExpressionPanel( public ReplaceColumnByExpressionPanel(
ReplaceColumnByExpressionDialog parent, ColumnData column, ReplaceColumnByExpressionDialog parent, ColumnData column,
ArrayList<ColumnData> columns, EventBus eventBus, ArrayList<ColumnData> columns, EventBus eventBus,
ReplaceColumnByExpressionType replaceColumnByExpressionType) { ReplaceExpressionType replaceExpressionType) {
super(); super();
this.parent = parent; this.parent = parent;
this.column = column; this.column = column;
this.columns = columns; this.columns = columns;
this.eventBus = eventBus; this.eventBus = eventBus;
this.replaceColumnByExpressionType = replaceColumnByExpressionType; this.replaceExpressionType = replaceExpressionType;
Log.debug("Column: " + column); Log.debug("Column: " + column);
Log.debug("Columns: " + columns); Log.debug("Columns: " + columns);
init(); init();
@ -330,7 +330,7 @@ public class ReplaceColumnByExpressionPanel extends FramedPanel {
ColumnDataType.Numeric.toString()) == 0 ColumnDataType.Numeric.toString()) == 0
|| column.getDataTypeName().compareTo( || column.getDataTypeName().compareTo(
ColumnDataType.Geometry.toString()) == 0) { ColumnDataType.Geometry.toString()) == 0) {
switch (replaceColumnByExpressionType) { switch (replaceExpressionType) {
case Replace: case Replace:
replaceWidget = new ReplaceWidget(column, REPLACEWIDTH, replaceWidget = new ReplaceWidget(column, REPLACEWIDTH,
REPLACEHEIGHT, eventBus); REPLACEHEIGHT, eventBus);
@ -522,7 +522,7 @@ public class ReplaceColumnByExpressionPanel extends FramedPanel {
return; return;
} }
switch (replaceColumnByExpressionType) { switch (replaceExpressionType) {
case Template: case Template:
C_ExpressionContainer conditionExpressionContainer; C_ExpressionContainer conditionExpressionContainer;
if (allRows) { if (allRows) {
@ -562,7 +562,7 @@ public class ReplaceColumnByExpressionPanel extends FramedPanel {
return; return;
} }
switch (replaceColumnByExpressionType) { switch (replaceExpressionType) {
case Template: case Template:
C_ExpressionContainer conditionExpressionContainer; C_ExpressionContainer conditionExpressionContainer;
if (allRows) { if (allRows) {
@ -669,7 +669,7 @@ public class ReplaceColumnByExpressionPanel extends FramedPanel {
} }
protected void close() { protected void close() {
switch (replaceColumnByExpressionType) { switch (replaceExpressionType) {
case Template: case Template:
ExpressionWrapper exWrapper=new ExpressionWrapper(); ExpressionWrapper exWrapper=new ExpressionWrapper();
ExpressionWrapperEvent expressionEvent = new ExpressionWrapperEvent( ExpressionWrapperEvent expressionEvent = new ExpressionWrapperEvent(

View File

@ -6,7 +6,7 @@ import org.gcube.portlets.user.td.expressionwidget.client.properties.ColumnDataP
import org.gcube.portlets.user.td.expressionwidget.client.properties.ReplaceElement; import org.gcube.portlets.user.td.expressionwidget.client.properties.ReplaceElement;
import org.gcube.portlets.user.td.expressionwidget.client.properties.ReplaceElementProperties; import org.gcube.portlets.user.td.expressionwidget.client.properties.ReplaceElementProperties;
import org.gcube.portlets.user.td.expressionwidget.client.properties.ReplaceElementStore; import org.gcube.portlets.user.td.expressionwidget.client.properties.ReplaceElementStore;
import org.gcube.portlets.user.td.expressionwidget.client.type.ReplaceColumnByExpressionType; import org.gcube.portlets.user.td.expressionwidget.client.type.ReplaceExpressionType;
import org.gcube.portlets.user.td.expressionwidget.client.utils.UtilsGXT3; import org.gcube.portlets.user.td.expressionwidget.client.utils.UtilsGXT3;
import org.gcube.portlets.user.td.expressionwidget.shared.exception.ReplaceTypeMapException; import org.gcube.portlets.user.td.expressionwidget.shared.exception.ReplaceTypeMapException;
import org.gcube.portlets.user.td.expressionwidget.shared.model.composite.arithmetic.C_ArithmeticExpression; import org.gcube.portlets.user.td.expressionwidget.shared.model.composite.arithmetic.C_ArithmeticExpression;
@ -85,7 +85,7 @@ public class ReplaceWidget extends SimpleContainer {
private String itemIdFirstArg; private String itemIdFirstArg;
private String itemIdSecondArg; private String itemIdSecondArg;
private String itemIdHoriz; private String itemIdHoriz;
private ReplaceColumnByExpressionType replaceColumnByExpressionType; private ReplaceExpressionType replaceExpressionType;
private ColumnDataType targetColumnType; private ColumnDataType targetColumnType;
@ -121,7 +121,7 @@ public class ReplaceWidget extends SimpleContainer {
public ReplaceWidget(ColumnData column, EventBus eventBus) { public ReplaceWidget(ColumnData column, EventBus eventBus) {
super(); super();
this.column=column; this.column=column;
replaceColumnByExpressionType = ReplaceColumnByExpressionType.Replace; replaceExpressionType = ReplaceExpressionType.Replace;
ColumnDataType targetType = ColumnDataType ColumnDataType targetType = ColumnDataType
.getColumnDataTypeFromId(column.getDataTypeName()); .getColumnDataTypeFromId(column.getDataTypeName());
create(column.getTrId(), targetType, WIDTH, HEIGHT, eventBus); create(column.getTrId(), targetType, WIDTH, HEIGHT, eventBus);
@ -132,7 +132,7 @@ public class ReplaceWidget extends SimpleContainer {
EventBus eventBus) { EventBus eventBus) {
super(); super();
this.column=column; this.column=column;
replaceColumnByExpressionType = ReplaceColumnByExpressionType.Replace; replaceExpressionType = ReplaceExpressionType.Replace;
ColumnDataType targetType = ColumnDataType ColumnDataType targetType = ColumnDataType
.getColumnDataTypeFromId(column.getDataTypeName()); .getColumnDataTypeFromId(column.getDataTypeName());
create(column.getTrId(), targetType, width, height, eventBus); create(column.getTrId(), targetType, width, height, eventBus);
@ -143,7 +143,7 @@ public class ReplaceWidget extends SimpleContainer {
EventBus eventBus) { EventBus eventBus) {
super(); super();
this.column=column; this.column=column;
replaceColumnByExpressionType = ReplaceColumnByExpressionType.Template; replaceExpressionType = ReplaceExpressionType.Template;
ColumnDataType targetType = ColumnDataType ColumnDataType targetType = ColumnDataType
.getColumnDataTypeFromId(column.getDataTypeName()); .getColumnDataTypeFromId(column.getDataTypeName());
create(column.getTrId(), targetType, WIDTH, HEIGHT, eventBus); create(column.getTrId(), targetType, WIDTH, HEIGHT, eventBus);
@ -154,13 +154,36 @@ public class ReplaceWidget extends SimpleContainer {
String width, String height, EventBus eventBus) { String width, String height, EventBus eventBus) {
super(); super();
this.column=column; this.column=column;
replaceColumnByExpressionType = ReplaceColumnByExpressionType.Template; replaceExpressionType = ReplaceExpressionType.Template;
ColumnDataType targetType = ColumnDataType ColumnDataType targetType = ColumnDataType
.getColumnDataTypeFromId(column.getDataTypeName()); .getColumnDataTypeFromId(column.getDataTypeName());
create(column.getTrId(), targetType, width, height, eventBus); create(column.getTrId(), targetType, width, height, eventBus);
columnsConfig(columns); columnsConfig(columns);
} }
public ReplaceWidget(ColumnData column, ArrayList<ColumnData> columns,
EventBus eventBus, ReplaceExpressionType type) {
super();
this.column=column;
replaceExpressionType = type;
ColumnDataType targetType = ColumnDataType
.getColumnDataTypeFromId(column.getDataTypeName());
create(column.getTrId(), targetType, WIDTH, HEIGHT, eventBus);
columnsConfig(columns);
}
public ReplaceWidget(ColumnData column, ArrayList<ColumnData> columns,
String width, String height, EventBus eventBus,ReplaceExpressionType type) {
super();
this.column=column;
replaceExpressionType = type;
ColumnDataType targetType = ColumnDataType
.getColumnDataTypeFromId(column.getDataTypeName());
create(column.getTrId(), targetType, width, height, eventBus);
columnsConfig(columns);
}
protected void create(TRId trId, ColumnDataType targetColumnType, protected void create(TRId trId, ColumnDataType targetColumnType,
String width, String height, EventBus eventBus) { String width, String height, EventBus eventBus) {
this.trId = trId; this.trId = trId;
@ -1025,8 +1048,9 @@ public class ReplaceWidget extends SimpleContainer {
* ColumnDataType cType = ColumnDataType * ColumnDataType cType = ColumnDataType
* .getColumnDataTypeFromId(column.getDataTypeName()); * .getColumnDataTypeFromId(column.getDataTypeName());
*/ */
switch (replaceColumnByExpressionType) { switch (replaceExpressionType) {
case Replace: case Replace:
case AddColumn:
expLeaf = mapReplace.map( expLeaf = mapReplace.map(
columnOfCombo, columnOfCombo,
ColumnDataType.Text, ColumnDataType.Text,
@ -1069,8 +1093,9 @@ public class ReplaceWidget extends SimpleContainer {
if (expContainerOperation == null) { if (expContainerOperation == null) {
return null; return null;
} else { } else {
switch (replaceColumnByExpressionType) { switch (replaceExpressionType) {
case Replace: case Replace:
case AddColumn:
exp = mapReplace.map( exp = mapReplace.map(
columnOfCombo, columnOfCombo,
targetType, targetType,
@ -1143,8 +1168,9 @@ public class ReplaceWidget extends SimpleContainer {
cType = ColumnDataType.getColumnDataTypeFromId(columnOfCombo cType = ColumnDataType.getColumnDataTypeFromId(columnOfCombo
.getDataTypeName()); .getDataTypeName());
switch (replaceColumnByExpressionType) { switch (replaceExpressionType) {
case Replace: case Replace:
case AddColumn:
expLeaf = mapReplace.map( expLeaf = mapReplace.map(
columnOfCombo, columnOfCombo,
cType, cType,
@ -1186,8 +1212,9 @@ public class ReplaceWidget extends SimpleContainer {
if (expContainerOperation == null) { if (expContainerOperation == null) {
return null; return null;
} else { } else {
switch (replaceColumnByExpressionType) { switch (replaceExpressionType) {
case Replace: case Replace:
case AddColumn:
exp = mapReplace.map( exp = mapReplace.map(
columnOfCombo, columnOfCombo,
targetType, targetType,
@ -1240,8 +1267,9 @@ public class ReplaceWidget extends SimpleContainer {
} }
} else { } else {
switch (replaceColumnByExpressionType) { switch (replaceExpressionType) {
case Replace: case Replace:
case AddColumn:
exp = mapReplace.map( exp = mapReplace.map(
columnOfCombo, columnOfCombo,
targetType, targetType,

View File

@ -247,9 +247,24 @@ public class ReplaceExpressionPanel extends FramedPanel {
ColumnDataType.Numeric.toString()) == 0 ColumnDataType.Numeric.toString()) == 0
|| column.getDataTypeName().compareTo( || column.getDataTypeName().compareTo(
ColumnDataType.Geometry.toString()) == 0) { ColumnDataType.Geometry.toString()) == 0) {
switch(type){
case AddColumn:
replaceWidget = new ReplaceWidget(column, columns,
REPLACEWIDTH, REPLACEHEIGHT, eventBus,type);
break;
case Replace:
replaceWidget = new ReplaceWidget(column, columns,
REPLACEWIDTH, REPLACEHEIGHT, eventBus, type);
break;
case Template:
replaceWidget = new ReplaceWidget(column, columns,
REPLACEWIDTH, REPLACEHEIGHT, eventBus);
break;
default:
break;
}
replaceWidget = new ReplaceWidget(column, columns,
REPLACEWIDTH, REPLACEHEIGHT, eventBus);
replaceValueFieldSetLayout.add(replaceWidget, replaceValueFieldSetLayout.add(replaceWidget,
new VerticalLayoutData(1, -1)); new VerticalLayoutData(1, -1));
@ -390,6 +405,7 @@ public class ReplaceExpressionPanel extends FramedPanel {
close(); close();
break; break;
case Replace: case Replace:
case AddColumn:
exWrapper = new ExpressionWrapper( exWrapper = new ExpressionWrapper(
replaceValue, column.getTrId(), column.getColumnId(), column.getName()); replaceValue, column.getTrId(), column.getColumnId(), column.getName());
expressionWrapperNotification=new ExpressionWrapperNotification(exWrapper); expressionWrapperNotification=new ExpressionWrapperNotification(exWrapper);
@ -432,6 +448,7 @@ public class ReplaceExpressionPanel extends FramedPanel {
close(); close();
break; break;
case Replace: case Replace:
case AddColumn:
replaceExpressionContainer = new C_ExpressionContainer( replaceExpressionContainer = new C_ExpressionContainer(
C_ExpressionContainer.Contains.C_Expression, C_ExpressionContainer.Contains.C_Expression,
cReplaceExpression, replaceWidget.getReadableExpression()); cReplaceExpression, replaceWidget.getReadableExpression());

View File

@ -3,9 +3,8 @@
*/ */
package org.gcube.portlets.user.td.expressionwidget.client.rpc; package org.gcube.portlets.user.td.expressionwidget.client.rpc;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTServiceException; import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTServiceException;
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.AddColumnSession;
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.FilterColumnSession; import org.gcube.portlets.user.td.gwtservice.shared.tr.column.FilterColumnSession;
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.ReplaceColumnByExpressionSession; import org.gcube.portlets.user.td.gwtservice.shared.tr.column.ReplaceColumnByExpressionSession;
@ -36,12 +35,14 @@ public interface ExpressionService extends RemoteService {
* @param columnFilterSession * @param columnFilterSession
* @throws ExpressionServiceException * @throws ExpressionServiceException
*/ */
public String startFilterColumn(FilterColumnSession filterColumnSession) throws TDGWTServiceException; public String startFilterColumn(FilterColumnSession filterColumnSession)
throws TDGWTServiceException;
public String startReplaceColumnByExpression(ReplaceColumnByExpressionSession replaceColumnByExpressionColumnSession) throws TDGWTServiceException;
public String startReplaceColumnByExpression(
ReplaceColumnByExpressionSession replaceColumnByExpressionColumnSession)
throws TDGWTServiceException;
public String startAddColumn(AddColumnSession addColumnSession)
throws TDGWTServiceException;
} }

View File

@ -3,6 +3,7 @@
*/ */
package org.gcube.portlets.user.td.expressionwidget.client.rpc; package org.gcube.portlets.user.td.expressionwidget.client.rpc;
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.AddColumnSession;
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.FilterColumnSession; import org.gcube.portlets.user.td.gwtservice.shared.tr.column.FilterColumnSession;
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.ReplaceColumnByExpressionSession; import org.gcube.portlets.user.td.gwtservice.shared.tr.column.ReplaceColumnByExpressionSession;
@ -21,9 +22,14 @@ public interface ExpressionServiceAsync {
public static ExpressionServiceAsync INSTANCE = (ExpressionServiceAsync) GWT public static ExpressionServiceAsync INSTANCE = (ExpressionServiceAsync) GWT
.create(ExpressionService.class); .create(ExpressionService.class);
void startFilterColumn(FilterColumnSession filterColumnSession,AsyncCallback<String> callback); void startFilterColumn(FilterColumnSession filterColumnSession,
AsyncCallback<String> callback);
void startReplaceColumnByExpression(ReplaceColumnByExpressionSession replaceColumnByExpressionSession,AsyncCallback<String> callback); void startReplaceColumnByExpression(
ReplaceColumnByExpressionSession replaceColumnByExpressionSession,
AsyncCallback<String> callback);
void startAddColumn(AddColumnSession addColumnSession,
AsyncCallback<String> callback);
} }

View File

@ -1,11 +0,0 @@
package org.gcube.portlets.user.td.expressionwidget.client.type;
/**
*
* @author giancarlo
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public enum ReplaceColumnByExpressionType {
Replace, Template;
}

View File

@ -21,6 +21,8 @@ import org.gcube.portlets.user.td.gwtservice.server.SessionUtil;
import org.gcube.portlets.user.td.gwtservice.server.TDGWTServiceImpl; import org.gcube.portlets.user.td.gwtservice.server.TDGWTServiceImpl;
import org.gcube.portlets.user.td.gwtservice.server.trservice.TabularResourceTypeMap; import org.gcube.portlets.user.td.gwtservice.server.trservice.TabularResourceTypeMap;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTServiceException; import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTServiceException;
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnMockUp;
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.AddColumnSession;
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.FilterColumnSession; import org.gcube.portlets.user.td.gwtservice.shared.tr.column.FilterColumnSession;
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.ReplaceColumnByExpressionSession; import org.gcube.portlets.user.td.gwtservice.shared.tr.column.ReplaceColumnByExpressionSession;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
@ -31,8 +33,8 @@ import com.google.gwt.user.server.rpc.RemoteServiceServlet;
/** /**
* *
* @author giancarlo * @author giancarlo email: <a
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a> * href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* *
*/ */
public class ExpressionServiceImpl extends RemoteServiceServlet implements public class ExpressionServiceImpl extends RemoteServiceServlet implements
@ -67,7 +69,7 @@ public class ExpressionServiceImpl extends RemoteServiceServlet implements
filterColumnSession); filterColumnSession);
C_ExpressionParser parser = new C_ExpressionParser(); C_ExpressionParser parser = new C_ExpressionParser();
Expression expression; Expression expression=null;
try { try {
expression = parser.parse(filterColumnSession.getCexpression()); expression = parser.parse(filterColumnSession.getCexpression());
} catch (ExpressionParserException e) { } catch (ExpressionParserException e) {
@ -87,8 +89,57 @@ public class ExpressionServiceImpl extends RemoteServiceServlet implements
throw e; throw e;
} catch (Throwable e) { } catch (Throwable e) {
e.printStackTrace(); e.printStackTrace();
throw new TDGWTServiceException("Filter Failed on Service: " throw new TDGWTServiceException(e.getLocalizedMessage());
+ e.getLocalizedMessage()); }
}
/**
*
* {@inheritDoc}
*/
public String startAddColumn(AddColumnSession addColumnSession)
throws TDGWTServiceException {
try {
logger.debug("AddColumn");
HttpSession session = this.getThreadLocalRequest().getSession();
logger.debug("Session: " + session);
if (addColumnSession == null) {
logger.error("AddColumnSession is null");
new ExpressionServiceException("AddColumnSession is null");
}
ColumnMockUp columnMockUp = addColumnSession.getColumnMockUp();
Expression expression=null;
if (columnMockUp.hasExpression()) {
C_ExpressionParser parser = new C_ExpressionParser();
try {
expression = parser.parse(columnMockUp.getExpression());
} catch (ExpressionParserException e) {
logger.debug(e.getLocalizedMessage());
throw new TDGWTServiceException(e.getLocalizedMessage());
}
logger.debug("Service Expression:" + expression);
}
TDGWTServiceImpl gwtService = new TDGWTServiceImpl();
String taskId = gwtService.startAddColumn(addColumnSession,
expression, session);
return taskId;
} catch (TDGWTServiceException e) {
throw e;
} catch (Throwable e) {
e.printStackTrace();
throw new TDGWTServiceException(e.getLocalizedMessage());
} }
} }
@ -116,7 +167,7 @@ public class ExpressionServiceImpl extends RemoteServiceServlet implements
C_ExpressionParser parser = new C_ExpressionParser(); C_ExpressionParser parser = new C_ExpressionParser();
Expression conditionExpression=null; Expression conditionExpression = null;
if (!replaceColumnByExpressionSession.isAllRows()) { if (!replaceColumnByExpressionSession.isAllRows()) {
try { try {
conditionExpression = parser conditionExpression = parser
@ -136,8 +187,7 @@ public class ExpressionServiceImpl extends RemoteServiceServlet implements
replaceExpression = parser replaceExpression = parser
.parse(replaceColumnByExpressionSession .parse(replaceColumnByExpressionSession
.getcReplaceExpression()); .getcReplaceExpression());
logger.debug("Service Replace Expression:" logger.debug("Service Replace Expression:" + replaceExpression);
+ replaceExpression);
} }
TDGWTServiceImpl gwtService = new TDGWTServiceImpl(); TDGWTServiceImpl gwtService = new TDGWTServiceImpl();
@ -152,8 +202,7 @@ public class ExpressionServiceImpl extends RemoteServiceServlet implements
} catch (Throwable e) { } catch (Throwable e) {
e.printStackTrace(); e.printStackTrace();
throw new TDGWTServiceException( throw new TDGWTServiceException(
"Error in startReplaceColumnByExpression:" e.getLocalizedMessage());
+ e.getLocalizedMessage());
} }
} }

View File

@ -81,7 +81,7 @@ public class ConditionTypeMap {
C_ColumnReferencePlaceholder placeHolder = new C_ColumnReferencePlaceholder( C_ColumnReferencePlaceholder placeHolder = new C_ColumnReferencePlaceholder(
dataType, column.getColumnId()); dataType, column.getColumnId());
Log.debug("placeHolder:" + placeHolder); Log.debug("placeHolder:" + placeHolder);
String readablePlaceHolder = column.getColumnId(); String readablePlaceHolder = column.getLabel();
TD_Value fArg; TD_Value fArg;
TD_Value sArg; TD_Value sArg;

View File

@ -212,10 +212,10 @@ public class ReplaceTypeMap {
String readablePlaceHolder; String readablePlaceHolder;
if(dataType!=ColumnDataType.Text){ if(dataType!=ColumnDataType.Text){
placeHolder=new C_Cast(placeH, ColumnDataType.Text); placeHolder=new C_Cast(placeH, ColumnDataType.Text);
readablePlaceHolder= "Cast("+column.getColumnId()+","+ColumnDataType.Text+")"; readablePlaceHolder= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
} else { } else {
placeHolder=placeH; placeHolder=placeH;
readablePlaceHolder= column.getColumnId(); readablePlaceHolder= column.getLabel();
} }
Log.debug("placeHolder:" + placeHolder); Log.debug("placeHolder:" + placeHolder);
@ -250,10 +250,10 @@ public class ReplaceTypeMap {
String readablePlaceHolder; String readablePlaceHolder;
if(dataType!=ColumnDataType.Text){ if(dataType!=ColumnDataType.Text){
placeHolder=new C_Cast(placeH, ColumnDataType.Text); placeHolder=new C_Cast(placeH, ColumnDataType.Text);
readablePlaceHolder= "Cast("+column.getColumnId()+","+ColumnDataType.Text+")"; readablePlaceHolder= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
} else { } else {
placeHolder=placeH; placeHolder=placeH;
readablePlaceHolder= column.getColumnId(); readablePlaceHolder= column.getLabel();
} }
Log.debug("placeHolder:" + placeHolder); Log.debug("placeHolder:" + placeHolder);
@ -289,10 +289,10 @@ public class ReplaceTypeMap {
String readablePlaceHolder; String readablePlaceHolder;
if(dataType!=ColumnDataType.Text){ if(dataType!=ColumnDataType.Text){
placeHolder=new C_Cast(placeH, ColumnDataType.Text); placeHolder=new C_Cast(placeH, ColumnDataType.Text);
readablePlaceHolder= "Cast("+column.getColumnId()+","+ColumnDataType.Text+")"; readablePlaceHolder= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
} else { } else {
placeHolder=placeH; placeHolder=placeH;
readablePlaceHolder= column.getColumnId(); readablePlaceHolder= column.getLabel();
} }
Log.debug("placeHolder:" + placeHolder); Log.debug("placeHolder:" + placeHolder);
@ -325,10 +325,10 @@ public class ReplaceTypeMap {
String readablePlaceHolder; String readablePlaceHolder;
if(dataType!=ColumnDataType.Text){ if(dataType!=ColumnDataType.Text){
placeHolder=new C_Cast(placeH, ColumnDataType.Text); placeHolder=new C_Cast(placeH, ColumnDataType.Text);
readablePlaceHolder= "Cast("+column.getColumnId()+","+ColumnDataType.Text+")"; readablePlaceHolder= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
} else { } else {
placeHolder=placeH; placeHolder=placeH;
readablePlaceHolder= column.getColumnId(); readablePlaceHolder= column.getLabel();
} }
Log.debug("placeHolder:" + placeHolder); Log.debug("placeHolder:" + placeHolder);
@ -357,10 +357,10 @@ public class ReplaceTypeMap {
String readablePlaceHolder; String readablePlaceHolder;
if(dataType!=targetType){ if(dataType!=targetType){
placeHolder=new C_Cast(placeH, targetType); placeHolder=new C_Cast(placeH, targetType);
readablePlaceHolder= "Cast("+column.getColumnId()+","+targetType+")"; readablePlaceHolder= "Cast("+column.getLabel()+","+targetType+")";
} else { } else {
placeHolder=placeH; placeHolder=placeH;
readablePlaceHolder= column.getColumnId(); readablePlaceHolder= column.getLabel();
} }
Log.debug("placeHolder:" + placeHolder); Log.debug("placeHolder:" + placeHolder);
@ -385,10 +385,10 @@ public class ReplaceTypeMap {
String readablePlaceHolder; String readablePlaceHolder;
if(dataType!=ColumnDataType.Text){ if(dataType!=ColumnDataType.Text){
placeHolder=new C_Cast(placeH, ColumnDataType.Text); placeHolder=new C_Cast(placeH, ColumnDataType.Text);
readablePlaceHolder= "Cast("+column.getColumnId()+","+ColumnDataType.Text+")"; readablePlaceHolder= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
} else { } else {
placeHolder=placeH; placeHolder=placeH;
readablePlaceHolder= column.getColumnId(); readablePlaceHolder= column.getLabel();
} }
Log.debug("placeHolder:" + placeHolder); Log.debug("placeHolder:" + placeHolder);
@ -415,10 +415,10 @@ public class ReplaceTypeMap {
String readablePlaceHolder; String readablePlaceHolder;
if(dataType!=ColumnDataType.Text){ if(dataType!=ColumnDataType.Text){
placeHolder=new C_Cast(placeH, ColumnDataType.Text); placeHolder=new C_Cast(placeH, ColumnDataType.Text);
readablePlaceHolder= "Cast("+column.getColumnId()+","+ColumnDataType.Text+")"; readablePlaceHolder= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
} else { } else {
placeHolder=placeH; placeHolder=placeH;
readablePlaceHolder= column.getColumnId(); readablePlaceHolder= column.getLabel();
} }
Log.debug("placeHolder:" + placeHolder); Log.debug("placeHolder:" + placeHolder);
@ -444,10 +444,10 @@ public class ReplaceTypeMap {
String readablePlaceHolder; String readablePlaceHolder;
if(dataType!=ColumnDataType.Text){ if(dataType!=ColumnDataType.Text){
placeHolder=new C_Cast(placeH, ColumnDataType.Text); placeHolder=new C_Cast(placeH, ColumnDataType.Text);
readablePlaceHolder= "Cast("+column.getColumnId()+","+ColumnDataType.Text+")"; readablePlaceHolder= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
} else { } else {
placeHolder=placeH; placeHolder=placeH;
readablePlaceHolder= column.getColumnId(); readablePlaceHolder= column.getLabel();
} }
Log.debug("placeHolder:" + placeHolder); Log.debug("placeHolder:" + placeHolder);
@ -474,10 +474,10 @@ public class ReplaceTypeMap {
String readablePlaceHolder; String readablePlaceHolder;
if(dataType!=ColumnDataType.Text){ if(dataType!=ColumnDataType.Text){
placeHolder=new C_Cast(placeH, ColumnDataType.Text); placeHolder=new C_Cast(placeH, ColumnDataType.Text);
readablePlaceHolder= "Cast("+column.getColumnId()+","+ColumnDataType.Text+")"; readablePlaceHolder= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
} else { } else {
placeHolder=placeH; placeHolder=placeH;
readablePlaceHolder= column.getColumnId(); readablePlaceHolder= column.getLabel();
} }
Log.debug("placeHolder:" + placeHolder); Log.debug("placeHolder:" + placeHolder);
@ -647,10 +647,10 @@ public class ReplaceTypeMap {
String readableColumnReference; String readableColumnReference;
if(dataType!=ColumnDataType.Text){ if(dataType!=ColumnDataType.Text){
columnReference=new C_Cast(columnRef,ColumnDataType.Text); columnReference=new C_Cast(columnRef,ColumnDataType.Text);
readableColumnReference= "Cast("+column.getColumnId()+","+ColumnDataType.Text+")"; readableColumnReference= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
} else { } else {
columnReference=columnRef; columnReference=columnRef;
readableColumnReference= column.getColumnId(); readableColumnReference= column.getLabel();
} }
Log.debug("Typed Column Reference:" + columnReference); Log.debug("Typed Column Reference:" + columnReference);
@ -686,10 +686,10 @@ public class ReplaceTypeMap {
String readableColumnReference; String readableColumnReference;
if(dataType!=ColumnDataType.Text){ if(dataType!=ColumnDataType.Text){
columnReference=new C_Cast(columnRef,ColumnDataType.Text); columnReference=new C_Cast(columnRef,ColumnDataType.Text);
readableColumnReference= "Cast("+column.getColumnId()+","+ColumnDataType.Text+")"; readableColumnReference= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
} else { } else {
columnReference=columnRef; columnReference=columnRef;
readableColumnReference= column.getColumnId(); readableColumnReference= column.getLabel();
} }
Log.debug("Typed Column Reference:" + columnReference); Log.debug("Typed Column Reference:" + columnReference);
@ -727,10 +727,10 @@ public class ReplaceTypeMap {
String readableColumnReference; String readableColumnReference;
if(dataType!=ColumnDataType.Text){ if(dataType!=ColumnDataType.Text){
columnReference=new C_Cast(columnRef,ColumnDataType.Text); columnReference=new C_Cast(columnRef,ColumnDataType.Text);
readableColumnReference= "Cast("+column.getColumnId()+","+ColumnDataType.Text+")"; readableColumnReference= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
} else { } else {
columnReference=columnRef; columnReference=columnRef;
readableColumnReference= column.getColumnId(); readableColumnReference= column.getLabel();
} }
Log.debug("Typed Column Reference:" + columnReference); Log.debug("Typed Column Reference:" + columnReference);
@ -764,10 +764,10 @@ public class ReplaceTypeMap {
String readableColumnReference; String readableColumnReference;
if(dataType!=ColumnDataType.Text){ if(dataType!=ColumnDataType.Text){
columnReference=new C_Cast(columnRef,ColumnDataType.Text); columnReference=new C_Cast(columnRef,ColumnDataType.Text);
readableColumnReference= "Cast("+column.getColumnId()+","+ColumnDataType.Text+")"; readableColumnReference= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
} else { } else {
columnReference=columnRef; columnReference=columnRef;
readableColumnReference= column.getColumnId(); readableColumnReference= column.getLabel();
} }
Log.debug("Typed Column Reference:" + columnReference); Log.debug("Typed Column Reference:" + columnReference);
@ -798,10 +798,10 @@ public class ReplaceTypeMap {
String readableColumnReference; String readableColumnReference;
if(dataType!=targetType){ if(dataType!=targetType){
columnReference=new C_Cast(columnRef,targetType); columnReference=new C_Cast(columnRef,targetType);
readableColumnReference= "Cast("+column.getColumnId()+","+targetType+")"; readableColumnReference= "Cast("+column.getLabel()+","+targetType+")";
} else { } else {
columnReference=columnRef; columnReference=columnRef;
readableColumnReference= column.getColumnId(); readableColumnReference= column.getLabel();
} }
Log.debug("Typed Column Reference:" + columnReference); Log.debug("Typed Column Reference:" + columnReference);
@ -827,10 +827,10 @@ public class ReplaceTypeMap {
String readableColumnReference; String readableColumnReference;
if(dataType!=ColumnDataType.Text){ if(dataType!=ColumnDataType.Text){
columnReference=new C_Cast(columnRef,ColumnDataType.Text); columnReference=new C_Cast(columnRef,ColumnDataType.Text);
readableColumnReference= "Cast("+column.getColumnId()+","+ColumnDataType.Text+")"; readableColumnReference= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
} else { } else {
columnReference=columnRef; columnReference=columnRef;
readableColumnReference= column.getColumnId(); readableColumnReference= column.getLabel();
} }
Log.debug("Typed Column Reference:" + columnReference); Log.debug("Typed Column Reference:" + columnReference);
@ -859,10 +859,10 @@ public class ReplaceTypeMap {
String readableColumnReference; String readableColumnReference;
if(dataType!=ColumnDataType.Text){ if(dataType!=ColumnDataType.Text){
columnReference=new C_Cast(columnRef,ColumnDataType.Text); columnReference=new C_Cast(columnRef,ColumnDataType.Text);
readableColumnReference= "Cast("+column.getColumnId()+","+ColumnDataType.Text+")"; readableColumnReference= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
} else { } else {
columnReference=columnRef; columnReference=columnRef;
readableColumnReference= column.getColumnId(); readableColumnReference= column.getLabel();
} }
Log.debug("Typed Column Reference:" + columnReference); Log.debug("Typed Column Reference:" + columnReference);
@ -892,10 +892,10 @@ public class ReplaceTypeMap {
String readableColumnReference; String readableColumnReference;
if(dataType!=ColumnDataType.Text){ if(dataType!=ColumnDataType.Text){
columnReference=new C_Cast(columnRef,ColumnDataType.Text); columnReference=new C_Cast(columnRef,ColumnDataType.Text);
readableColumnReference= "Cast("+column.getColumnId()+","+ColumnDataType.Text+")"; readableColumnReference= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
} else { } else {
columnReference=columnRef; columnReference=columnRef;
readableColumnReference= column.getColumnId(); readableColumnReference= column.getLabel();
} }
Log.debug("Typed Column Reference:" + columnReference); Log.debug("Typed Column Reference:" + columnReference);
@ -924,10 +924,10 @@ public class ReplaceTypeMap {
String readableColumnReference; String readableColumnReference;
if(dataType!=ColumnDataType.Text){ if(dataType!=ColumnDataType.Text){
columnReference=new C_Cast(columnRef,ColumnDataType.Text); columnReference=new C_Cast(columnRef,ColumnDataType.Text);
readableColumnReference= "Cast("+column.getColumnId()+","+ColumnDataType.Text+")"; readableColumnReference= "Cast("+column.getLabel()+","+ColumnDataType.Text+")";
} else { } else {
columnReference=columnRef; columnReference=columnRef;
readableColumnReference= column.getColumnId(); readableColumnReference= column.getLabel();
} }
Log.debug("Typed Column Reference:" + columnReference); Log.debug("Typed Column Reference:" + columnReference);