Search in sources :

Example 1 with TransposeRowsIntoColumnsOperation

use of com.google.refine.operations.cell.TransposeRowsIntoColumnsOperation in project OpenRefine by OpenRefine.

the class TransposeRowsIntoColumnsCommand method doPost.

@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    if (!hasValidCSRFToken(request)) {
        respondCSRFError(response);
        return;
    }
    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);
    }
}
Also used : TransposeRowsIntoColumnsOperation(com.google.refine.operations.cell.TransposeRowsIntoColumnsOperation) Project(com.google.refine.model.Project) AbstractOperation(com.google.refine.model.AbstractOperation) Process(com.google.refine.process.Process) Properties(java.util.Properties) ServletException(javax.servlet.ServletException) IOException(java.io.IOException)

Aggregations

AbstractOperation (com.google.refine.model.AbstractOperation)1 Project (com.google.refine.model.Project)1 TransposeRowsIntoColumnsOperation (com.google.refine.operations.cell.TransposeRowsIntoColumnsOperation)1 Process (com.google.refine.process.Process)1 IOException (java.io.IOException)1 Properties (java.util.Properties)1 ServletException (javax.servlet.ServletException)1