Examples of OAIPMHImporter


Examples of net.yacy.document.importer.OAIPMHImporter

                String oaipmhurl = post.get("urlstart", "");
                sb.tables.recordAPICall(post, "IndexImportOAIPMH_p.html", WorkTables.TABLE_API_TYPE_CRAWLER, "OAI-PMH import for " + oaipmhurl);
                DigestURI url = null;
                try {
                    url = new DigestURI(oaipmhurl);
                    OAIPMHImporter job = new OAIPMHImporter(sb.loader, url);
                    job.start();
                    prop.put("status", 1);
                    prop.put("optiongetlist", 1);
                    prop.put("iframetype", 1);
                } catch (MalformedURLException e) {
                    Log.logException(e);
                    prop.put("status", 2);
                    prop.put("status_message", e.getMessage());
                }
            }
           
           
            if (post.get("loadrows", "").length() > 0) {
                // create a time-ordered list of events to execute
                Set<String> sources = new TreeSet<String>();
                for (final Map.Entry<String, String> entry: post.entrySet()) {
                    if (entry.getValue().startsWith("mark_")) {
                        sources.add(entry.getValue().substring(5));
                    }
                }
                prop.put("status", 1);
                prop.put("optiongetlist", 1);
                prop.put("iframetype", 1);
               
                // prepare the set for random read from it (to protect the servers at the beginning of the list)
                List<String> sourceList = new ArrayList<String>(sources.size());
                for (String oaipmhurl: sources) sourceList.add(oaipmhurl);
                Random r = new Random(System.currentTimeMillis());
               
                // start jobs for the sources
                DigestURI url = null;
                while (sourceList.size() > 0) {
                    String oaipmhurl = sourceList.remove(r.nextInt(sourceList.size()));
                    try {
                        url = new DigestURI(oaipmhurl);
                        OAIPMHImporter job = new OAIPMHImporter(sb.loader, url);
                        job.start();
                    } catch (MalformedURLException e) {
                        Log.logException(e);
                    }
                }
            }
View Full Code Here

Examples of net.yacy.document.importer.OAIPMHImporter

                final String oaipmhurl = post.get("urlstart", "");
                sb.tables.recordAPICall(post, "IndexImportOAIPMH_p.html", WorkTables.TABLE_API_TYPE_CRAWLER, "OAI-PMH import for " + oaipmhurl);
                DigestURI url = null;
                try {
                    url = new DigestURI(oaipmhurl);
                    final OAIPMHImporter job = new OAIPMHImporter(sb.loader, url);
                    job.start();
                    prop.put("status", 1);
                    prop.put("optiongetlist", 1);
                    prop.put("iframetype", 1);
                } catch (final MalformedURLException e) {
                    Log.logException(e);
                    prop.put("status", 2);
                    prop.put("status_message", e.getMessage());
                }
            }


            if (post.get("loadrows", "").length() > 0) {
                // create a time-ordered list of events to execute
                final Set<String> sources = new TreeSet<String>();
                for (final Map.Entry<String, String> entry: post.entrySet()) {
                    if (entry.getValue().startsWith("mark_")) {
                        sources.add(entry.getValue().substring(5));
                    }
                }
                prop.put("status", 1);
                prop.put("optiongetlist", 1);
                prop.put("iframetype", 1);

                // prepare the set for random read from it (to protect the servers at the beginning of the list)
                final List<String> sourceList = new ArrayList<String>(sources.size());
                for (final String oaipmhurl: sources) sourceList.add(oaipmhurl);
                final Random r = new Random(System.currentTimeMillis());

                // start jobs for the sources
                DigestURI url = null;
                while (sourceList.size() > 0) {
                    final String oaipmhurl = sourceList.remove(r.nextInt(sourceList.size()));
                    try {
                        url = new DigestURI(oaipmhurl);
                        final OAIPMHImporter job = new OAIPMHImporter(sb.loader, url);
                        job.start();
                    } catch (final MalformedURLException e) {
                        Log.logException(e);
                    }
                }
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.