2010-02-05 00:38:40 +01:00
|
|
|
package com.metaweb.gridworks.commands.edit;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
|
|
import org.json.JSONObject;
|
|
|
|
|
|
|
|
import com.metaweb.gridworks.commands.EngineDependentCommand;
|
|
|
|
import com.metaweb.gridworks.model.AbstractOperation;
|
|
|
|
import com.metaweb.gridworks.model.operations.ColumnAdditionOperation;
|
|
|
|
|
|
|
|
public class AddColumnCommand extends EngineDependentCommand {
|
|
|
|
@Override
|
|
|
|
protected AbstractOperation createOperation(HttpServletRequest request,
|
|
|
|
JSONObject engineConfig) throws Exception {
|
|
|
|
|
2010-02-17 01:26:38 +01:00
|
|
|
String baseColumnName = request.getParameter("baseColumnName");
|
2010-02-05 00:38:40 +01:00
|
|
|
String expression = request.getParameter("expression");
|
|
|
|
String headerLabel = request.getParameter("headerLabel");
|
|
|
|
int columnInsertIndex = Integer.parseInt(request.getParameter("columnInsertIndex"));
|
|
|
|
|
|
|
|
return new ColumnAdditionOperation(
|
|
|
|
engineConfig,
|
2010-02-17 01:26:38 +01:00
|
|
|
baseColumnName,
|
2010-02-05 00:38:40 +01:00
|
|
|
expression,
|
|
|
|
headerLabel,
|
|
|
|
columnInsertIndex
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|