2010-03-16 01:24:20 +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.Project;
|
|
|
|
import com.metaweb.gridworks.operations.ExtendDataOperation;
|
2010-03-21 21:26:35 +01:00
|
|
|
import com.metaweb.gridworks.util.ParsingUtilities;
|
2010-03-16 01:24:20 +01:00
|
|
|
|
|
|
|
public class ExtendDataCommand extends EngineDependentCommand {
|
|
|
|
@Override
|
|
|
|
protected AbstractOperation createOperation(Project project,
|
|
|
|
HttpServletRequest request, JSONObject engineConfig) throws Exception {
|
|
|
|
|
|
|
|
String baseColumnName = request.getParameter("baseColumnName");
|
|
|
|
int columnInsertIndex = Integer.parseInt(request.getParameter("columnInsertIndex"));
|
|
|
|
|
|
|
|
String jsonString = request.getParameter("extension");
|
2010-03-21 21:26:35 +01:00
|
|
|
JSONObject extension = ParsingUtilities.evaluateJsonStringToObject(jsonString);
|
2010-03-16 01:24:20 +01:00
|
|
|
|
|
|
|
return new ExtendDataOperation(
|
|
|
|
engineConfig,
|
|
|
|
baseColumnName,
|
|
|
|
extension,
|
|
|
|
columnInsertIndex
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|