2010-05-17 04:01:08 +02:00
|
|
|
package com.metaweb.gridworks.commands.cell;
|
2010-05-05 01:24:48 +02:00
|
|
|
|
|
|
|
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.Project;
|
2010-05-21 20:15:13 +02:00
|
|
|
import com.metaweb.gridworks.operations.cell.MassEditOperation;
|
2010-05-05 01:24:48 +02:00
|
|
|
import com.metaweb.gridworks.util.ParsingUtilities;
|
|
|
|
|
|
|
|
public class MassEditCommand extends EngineDependentCommand {
|
|
|
|
@Override
|
|
|
|
protected AbstractOperation createOperation(Project project,
|
|
|
|
HttpServletRequest request, JSONObject engineConfig) throws Exception {
|
|
|
|
|
|
|
|
String columnName = request.getParameter("columnName");
|
|
|
|
String expression = request.getParameter("expression");
|
|
|
|
String editsString = request.getParameter("edits");
|
|
|
|
|
|
|
|
return new MassEditOperation(
|
|
|
|
engineConfig,
|
|
|
|
columnName,
|
|
|
|
expression,
|
|
|
|
MassEditOperation.reconstructEdits(ParsingUtilities.evaluateJsonStringToArray(editsString))
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|