// Path: src/main/java/certh/iti/mklab/easie/configuration/Configuration.java
// public static class ScrapableField {
// 
//     public Object label;
// 
//     public Object value;
// 
//     public Object citeyear;
// 
//     public void setLabel(ExtractionProperties ep) {
//         label = ep;
//     }
// 
//     public void setValue(ExtractionProperties ep) {
//         value = ep;
//     }
// 
//     public void setCiteyear(ExtractionProperties ep) {
//         citeyear = ep;
//     }
// }
// 
// Path: src/main/java/certh/iti/mklab/easie/extractors/AbstractHTMLExtractor.java
// public abstract class AbstractHTMLExtractor {
//    
//    public abstract List extractFields(List<ScrapableField> fields) throws URISyntaxException, IOException, InterruptedException, KeyManagementException;
//    
//    public abstract List extractTable(String tableSelector, List<ScrapableField> fields) throws URISyntaxException, IOException, InterruptedException, KeyManagementException;
//    
//    public abstract Pair extractFields(List<ScrapableField> cfields, List<ScrapableField> sfields) throws URISyntaxException, IOException, InterruptedException, KeyManagementException;
//    
//    public abstract Pair extractTable(String tableSelector, List<ScrapableField> cfields, List<ScrapableField> sfields) throws URISyntaxException, IOException, InterruptedException, KeyManagementException;
// }


import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.lang3.tuple.Pair;
import org.bson.Document;
import certh.iti.mklab.easie.configuration.Configuration.ScrapableField;
import certh.iti.mklab.easie.extractors.AbstractHTMLExtractor;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

/*
 * Copyright 2016 vasgat.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package certh.iti.mklab.easie.extractors.staticpages;




/**
 * BunchWrapper object extends AbstractWrapper and is responsible for extracting
 * data from a set of links - webpages with the same structure
 *
 * @author vasgat
 */
public class GroupHTMLExtractor extends AbstractHTMLExtractor {

    private HashSet<String> group_of_urls;
    private String base_url;
    private int numThreads;

    /**
     * Creates a new BunchWrapper
     *
     * @param group_of_urls a set of webpages
     */
    public GroupHTMLExtractor(HashSet<String> group_of_urls) {
        this.base_url = "";
        this.group_of_urls = group_of_urls;
        this.numThreads = 10;
    }

    public GroupHTMLExtractor(HashSet<String> group_of_urls, String base_url) {
        this.base_url = base_url;
        this.group_of_urls = group_of_urls;
        this.numThreads = 10;
    }

    /**
     * Extracts specified field for each webpage
     *
     * @param fields set of fields
     * @return the extracted Fields
     * @throws URISyntaxException
     * @throws IOException
     * @throws Exception
     */
    @Override

// Path: src/main/java/certh/iti/mklab/easie/configuration/Configuration.java
// public static class ScrapableField {
// 
//     public Object label;
// 
//     public Object value;
// 
//     public Object citeyear;
// 
//     public void setLabel(ExtractionProperties ep) {
//         label = ep;
//     }
// 
//     public void setValue(ExtractionProperties ep) {
//         value = ep;
//     }
// 
//     public void setCiteyear(ExtractionProperties ep) {
//         citeyear = ep;
//     }
// }
// 
// Path: src/main/java/certh/iti/mklab/easie/extractors/AbstractHTMLExtractor.java
// public abstract class AbstractHTMLExtractor {
//    
//    public abstract List extractFields(List<ScrapableField> fields) throws URISyntaxException, IOException, InterruptedException, KeyManagementException;
//    
//    public abstract List extractTable(String tableSelector, List<ScrapableField> fields) throws URISyntaxException, IOException, InterruptedException, KeyManagementException;
//    
//    public abstract Pair extractFields(List<ScrapableField> cfields, List<ScrapableField> sfields) throws URISyntaxException, IOException, InterruptedException, KeyManagementException;
//    
//    public abstract Pair extractTable(String tableSelector, List<ScrapableField> cfields, List<ScrapableField> sfields) throws URISyntaxException, IOException, InterruptedException, KeyManagementException;
// }


// Path: src/main/java/certh/iti/mklab/easie/extractors/staticpages/GroupHTMLExtractor.java
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.lang3.tuple.Pair;
import org.bson.Document;
import certh.iti.mklab.easie.configuration.Configuration.ScrapableField;
import certh.iti.mklab.easie.extractors.AbstractHTMLExtractor;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

/*
 * Copyright 2016 vasgat.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package certh.iti.mklab.easie.extractors.staticpages;




/**
 * BunchWrapper object extends AbstractWrapper and is responsible for extracting
 * data from a set of links - webpages with the same structure
 *
 * @author vasgat
 */
public class GroupHTMLExtractor extends AbstractHTMLExtractor {

    private HashSet<String> group_of_urls;
    private String base_url;
    private int numThreads;

    /**
     * Creates a new BunchWrapper
     *
     * @param group_of_urls a set of webpages
     */
    public GroupHTMLExtractor(HashSet<String> group_of_urls) {
        this.base_url = "";
        this.group_of_urls = group_of_urls;
        this.numThreads = 10;
    }

    public GroupHTMLExtractor(HashSet<String> group_of_urls, String base_url) {
        this.base_url = base_url;
        this.group_of_urls = group_of_urls;
        this.numThreads = 10;
    }

    /**
     * Extracts specified field for each webpage
     *
     * @param fields set of fields
     * @return the extracted Fields
     * @throws URISyntaxException
     * @throws IOException
     * @throws Exception
     */
    @Override

    public List<Document> extractFields(List<ScrapableField> fields) throws URISyntaxException, IOException {
