2010-02-22 02:28:13 +01:00
|
|
|
package com.metaweb.gridworks.commands.recon;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
2010-02-22 21:25:45 +01:00
|
|
|
import org.json.JSONObject;
|
2010-02-22 02:28:13 +01:00
|
|
|
|
2010-02-22 21:25:45 +01:00
|
|
|
import com.metaweb.gridworks.commands.EngineDependentCommand;
|
|
|
|
import com.metaweb.gridworks.model.AbstractOperation;
|
2010-03-03 22:21:38 +01:00
|
|
|
import com.metaweb.gridworks.model.Project;
|
2010-02-22 23:15:48 +01:00
|
|
|
import com.metaweb.gridworks.model.Recon;
|
2010-02-22 02:28:13 +01:00
|
|
|
import com.metaweb.gridworks.model.ReconCandidate;
|
2010-02-22 23:15:48 +01:00
|
|
|
import com.metaweb.gridworks.model.Recon.Judgment;
|
2010-02-22 21:25:45 +01:00
|
|
|
import com.metaweb.gridworks.operations.ReconJudgeSimilarCellsOperation;
|
2010-02-22 02:28:13 +01:00
|
|
|
|
2010-02-22 21:25:45 +01:00
|
|
|
public class ReconJudgeSimilarCellsCommand extends EngineDependentCommand {
|
2010-02-22 02:28:13 +01:00
|
|
|
|
2010-03-03 05:19:58 +01:00
|
|
|
@Override
|
|
|
|
protected AbstractOperation createOperation(
|
2010-03-03 22:21:38 +01:00
|
|
|
Project project, HttpServletRequest request, JSONObject engineConfig) throws Exception {
|
2010-03-03 05:19:58 +01:00
|
|
|
|
|
|
|
String columnName = request.getParameter("columnName");
|
|
|
|
String similarValue = request.getParameter("similarValue");
|
|
|
|
Judgment judgment = Recon.stringToJudgment(request.getParameter("judgment"));
|
|
|
|
|
|
|
|
ReconCandidate match = null;
|
|
|
|
String topicID = request.getParameter("topicID");
|
|
|
|
if (topicID != null) {
|
|
|
|
String scoreString = request.getParameter("score");
|
|
|
|
|
|
|
|
match = new ReconCandidate(
|
|
|
|
topicID,
|
|
|
|
request.getParameter("topicGUID"),
|
|
|
|
request.getParameter("topicName"),
|
|
|
|
request.getParameter("types").split(","),
|
|
|
|
scoreString != null ? Double.parseDouble(scoreString) : 100
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
String shareNewTopics = request.getParameter("shareNewTopics");
|
|
|
|
|
|
|
|
return new ReconJudgeSimilarCellsOperation(
|
|
|
|
engineConfig,
|
|
|
|
columnName,
|
|
|
|
similarValue,
|
|
|
|
judgment,
|
|
|
|
match,
|
|
|
|
"true".equals(shareNewTopics)
|
|
|
|
);
|
|
|
|
}
|
2010-02-22 02:28:13 +01:00
|
|
|
}
|