Package com.google.refine.preference

Examples of com.google.refine.preference.PreferenceStore


    @Override
    public void doGet(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");
        Object pref = ps.get(prefName);
       
        try {
            response.setCharacterEncoding("UTF-8");
            response.setHeader("Content-Type", "application/json");
           
View Full Code Here


    @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");
       
        try {
            Object o = valueString == null ? null : new JSONTokener(valueString).nextValue();
           
            ps.put(prefName, PreferenceStore.loadObject(o));
           
            respond(response, "{ \"code\" : \"ok\" }");
        } catch (JSONException e) {
            respondException(response, e);
        }
View Full Code Here

       
        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")) {
View Full Code Here

    static public ProjectManager singleton;

    protected ProjectManager(){
        _projectsMetadata = new HashMap<Long, ProjectMetadata>();
        _preferenceStore = new PreferenceStore();
        _projects = new HashMap<Long, Project>();

        preparePreferenceStore(_preferenceStore);
    }
View Full Code Here

                return;
            }

            identifierSpaceToUrl = new HashMap<String, String>();
           
            PreferenceStore ps = ProjectManager.singleton.getPreferenceStore();
            JSONArray services = (JSONArray) ps.get("reconciliation.standardServices");
            if (services != null) {
                int count = services.length();
               
                for (int i = 0; i < count; i++) {
                    JSONObject service = JSONUtilities.getObjectElement(services, i);
View Full Code Here

    @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();
               
        try {
            response.setCharacterEncoding("UTF-8");
            response.setHeader("Content-Type", "application/json");
           
            JSONWriter writer = new JSONWriter(response.getWriter());
           
            writer.object();
           
            for (String key : ps.getKeys()) {
                Object pref = ps.get(key);
                if (pref == null || pref instanceof String || pref instanceof Number || pref instanceof Boolean) {
                    writer.key(key);
                    writer.value(pref);
                }
            }
View Full Code Here

TOP

Related Classes of com.google.refine.preference.PreferenceStore

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.