use of com.google.refine.process.Process in project OpenRefine by OpenRefine.
the class TransposeRowsIntoColumnsCommand method doPost.
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
Project project = getProject(request);
String columnName = request.getParameter("columnName");
int rowCount = Integer.parseInt(request.getParameter("rowCount"));
AbstractOperation op = new TransposeRowsIntoColumnsOperation(columnName, rowCount);
Process process = op.createProcess(project, new Properties());
performProcessAndRespond(request, response, project, process);
} catch (Exception e) {
respondException(response, e);
}
}
use of com.google.refine.process.Process in project OpenRefine by OpenRefine.
the class RemoveColumnCommand method doPost.
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
Project project = getProject(request);
String columnName = request.getParameter("columnName");
AbstractOperation op = new ColumnRemovalOperation(columnName);
Process process = op.createProcess(project, new Properties());
performProcessAndRespond(request, response, project, process);
} catch (Exception e) {
respondException(response, e);
}
}
use of com.google.refine.process.Process in project OpenRefine by OpenRefine.
the class RenameColumnCommand method doPost.
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
Project project = getProject(request);
String oldColumnName = request.getParameter("oldColumnName");
String newColumnName = request.getParameter("newColumnName");
AbstractOperation op = new ColumnRenameOperation(oldColumnName, newColumnName);
Process process = op.createProcess(project, new Properties());
performProcessAndRespond(request, response, project, process);
} catch (Exception e) {
respondException(response, e);
}
}
use of com.google.refine.process.Process in project OpenRefine by OpenRefine.
the class TransposeColumnsIntoRowsCommand method doPost.
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
Project project = getProject(request);
AbstractOperation op;
String startColumnName = request.getParameter("startColumnName");
int columnCount = Integer.parseInt(request.getParameter("columnCount"));
boolean ignoreBlankCells = Boolean.parseBoolean(request.getParameter("ignoreBlankCells"));
boolean fillDown = Boolean.parseBoolean(request.getParameter("fillDown"));
String combinedColumnName = request.getParameter("combinedColumnName");
if (combinedColumnName != null) {
boolean prependColumnName = Boolean.parseBoolean(request.getParameter("prependColumnName"));
String separator = request.getParameter("separator");
op = new TransposeColumnsIntoRowsOperation(startColumnName, columnCount, ignoreBlankCells, fillDown, combinedColumnName, prependColumnName, separator);
} else {
String keyColumnName = request.getParameter("keyColumnName");
String valueColumnName = request.getParameter("valueColumnName");
op = new TransposeColumnsIntoRowsOperation(startColumnName, columnCount, ignoreBlankCells, fillDown, keyColumnName, valueColumnName);
}
Process process = op.createProcess(project, new Properties());
performProcessAndRespond(request, response, project, process);
} catch (Exception e) {
respondException(response, e);
}
}
use of com.google.refine.process.Process in project OpenRefine by OpenRefine.
the class MoveColumnCommand method doPost.
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
Project project = getProject(request);
String columnName = request.getParameter("columnName");
int index = Integer.parseInt(request.getParameter("index"));
AbstractOperation op = new ColumnMoveOperation(columnName, index);
Process process = op.createProcess(project, new Properties());
performProcessAndRespond(request, response, project, process);
} catch (Exception e) {
respondException(response, e);
}
}
Aggregations