365868564f
git-svn-id: http://google-refine.googlecode.com/svn/branches/split-refactor@905 7d457c2a-affb-35e4-300a-418c747d4874
35 lines
1.2 KiB
Java
35 lines
1.2 KiB
Java
package com.metaweb.gridworks.commands.row;
|
|
|
|
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.row.RowFlagOperation;
|
|
import com.metaweb.gridworks.operations.row.RowStarOperation;
|
|
|
|
public class AnnotateRowsCommand extends EngineDependentCommand {
|
|
|
|
@Override
|
|
protected AbstractOperation createOperation(Project project,
|
|
HttpServletRequest request, JSONObject engineConfig) throws Exception {
|
|
|
|
String starredString = request.getParameter("starred");
|
|
if (starredString != null) {
|
|
boolean starred = "true".endsWith(starredString);
|
|
|
|
return new RowStarOperation(engineConfig, starred);
|
|
}
|
|
|
|
String flaggedString = request.getParameter("flagged");
|
|
if (flaggedString != null) {
|
|
boolean flagged = "true".endsWith(flaggedString);
|
|
|
|
return new RowFlagOperation(engineConfig, flagged);
|
|
}
|
|
return null;
|
|
}
|
|
}
|