Package com.google.refine.model

Examples of com.google.refine.model.Project


            _futureEntries.add(0, entry);
        }
    }

    protected void redo(int times) {
        Project project = ProjectManager.singleton.getProject(_projectID);

        while (times > 0 && _futureEntries.size() > 0) {
            HistoryEntry entry = _futureEntries.get(0);

            entry.apply(project);
View Full Code Here


            return -1;
        }
       
        JSONUtilities.safePut(job.config, "state", "creating-project");
       
        final Project project = new Project();
        if (synchronous) {
            createProjectSynchronously(
                job, format, optionObj, exceptions, record, project);
        } else {
            new Thread() {
View Full Code Here

public class SetPreferenceCommand extends Command {
    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
       
        Project project = request.getParameter("project") != null ? getProject(request) : null;
        PreferenceStore ps = project != null ?
                project.getMetadata().getPreferenceStore() :
                ProjectManager.singleton.getPreferenceStore();
               
        String prefName = request.getParameter("name");
        String valueString = request.getParameter("value");
       
View Full Code Here

    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
       
        try {
            Project project = getProject(request);
           
            AbstractOperation op = createOperation(project, request, getEngineConfig(request));
            Process process = op.createProcess(project, new Properties());
           
            performProcessAndRespond(request, response, project, process);
View Full Code Here

    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {

        try {
            Project project = getProject(request);

            int rowIndex = Integer.parseInt(request.getParameter("row"));
            int cellIndex = Integer.parseInt(request.getParameter("cell"));

            ClearOneCellProcess process = new ClearOneCellProcess(
View Full Code Here

    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
       
        try {
            Project project = getProject(request);
           
            String jsonString = request.getParameter("protograph");
            JSONObject json = ParsingUtilities.evaluateJsonStringToObject(jsonString);
            Protograph protograph = Protograph.reconstruct(json);
           
View Full Code Here

        } else if ("record".equals(name)) {
            int rowIndex = (Integer) bindings.get("rowIndex");
           
            return new WrappedRecord(project.recordModel.getRecordOfRow(rowIndex));
        } else if ("columnNames".equals(name)) {
            Project project = (Project) bindings.get("project");
           
            return project.columnModel.getColumnNames();
        } else {
            return row.getField(name, bindings);
        }
View Full Code Here

    public void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
       
        ProjectManager.singleton.setBusy(true);
        try {
            Project project = getProject(request);
            Engine engine = getEngine(request, project);
            PreferenceStore preferenceStore = project.getMetadata().getPreferenceStore();
           
            TripleLoaderExporter exporter = new TripleLoaderExporter();
            StringWriter triples = new StringWriter(10 * 1024 * 1024);
            exporter.export(project, new Properties(), engine, triples);

            String source_name = request.getParameter("source_name");
            String source_id = request.getParameter("source_id");
            String qa = request.getParameter("qa");
            String mdo_id = null;
           
            preferenceStore.put(s_dataLoadJobNamePref, source_name);
           
            try {
                Integer jobID = (Integer) preferenceStore.get(s_dataLoadJobIDPref);
                if (jobID != null) {
                    URL url = new URL("http://refinery.freebaseapps.com/job_id_to_mdo?job=" + jobID);
                    String s = ParsingUtilities.inputStreamToString(url.openConnection().getInputStream());
                   
                    if (!s.equals("null")) {
                        mdo_id = s;
                    }
                }
            } catch (Exception e) {
                // ignore
            }
           
            String uploadResponse = FreebaseUtils.uploadTriples(
                request, qa, source_name, source_id, mdo_id, triples.toString()
            );
           
            response.setCharacterEncoding("UTF-8");
            response.setHeader("Content-Type", "application/json");
           
            try {
                JSONObject obj = new JSONObject(uploadResponse);
                if (obj.has("result") && !obj.isNull("result")) {
                    JSONObject result = obj.getJSONObject("result");
                    if (result.has("job_id") && !result.isNull("job_id")) {
                        Integer jobID = result.getInt("job_id");
                        project.getMetadata().getPreferenceStore().put(s_dataLoadJobIDPref, jobID);
                    }
                }
                response.getWriter().write(uploadResponse);
            } catch (JSONException e) {
                respond(response,"500 Error", uploadResponse);
View Full Code Here

    public void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
       
        ProjectManager.singleton.setBusy(true);
        try {
            Project project = getProject(request);
           
            AbstractOperation op = new ImportQADataOperation();
            Process process = op.createProcess(project, new Properties());
           
            performProcessAndRespond(request, response, project, process);
View Full Code Here

    public void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
       
        try {
            long start = System.currentTimeMillis();
            Project project = getProject(request);
            Engine engine = getEngine(request, project);
            JSONObject clusterer_conf = getJsonParameter(request,"clusterer");

            Clusterer clusterer = null;
            String type = clusterer_conf.has("type") ? clusterer_conf.getString("type") : "binning";
View Full Code Here

TOP

Related Classes of com.google.refine.model.Project

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.