Changeset 2368


Ignore:
Timestamp:
11/22/12 14:11:39 (12 years ago)
Author:
herste
Message:

added a some resourceType=SearchService? parsing, not in solr document yet

Location:
vlo/trunk/vlo_webapp/src/main/java/eu/clarin/cmdi/vlo/importer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • vlo/trunk/vlo_webapp/src/main/java/eu/clarin/cmdi/vlo/importer/CMDIData.java

    r1230 r2368  
    11package eu.clarin.cmdi.vlo.importer;
     2
     3import eu.clarin.cmdi.vlo.FacetConstants;
     4import org.apache.solr.common.SolrInputDocument;
     5import org.slf4j.Logger;
     6import org.slf4j.LoggerFactory;
    27
    38import java.util.ArrayList;
     
    510import java.util.List;
    611
    7 import org.apache.solr.common.SolrInputDocument;
    8 import org.slf4j.Logger;
    9 import org.slf4j.LoggerFactory;
    10 
    11 import eu.clarin.cmdi.vlo.FacetConstants;
    12 
    1312public class CMDIData {
    1413    private final static Logger LOG = LoggerFactory.getLogger(CMDIData.class);
    1514    private static final String METADATA_TYPE = "Metadata";
    1615    private static final String DATA_RESOURCE_TYPE = "Resource";
     16    private static final String SEARCH_SERVICE_TYPE = "SearchService";
    1717
    1818    private String id;
     
    2020    private SolrInputDocument doc;
    2121    private List<Resource> dataResources = new ArrayList<Resource>();
     22    private List<Resource> searchResources = new ArrayList<Resource>();
    2223
    2324    public SolrInputDocument getSolrDocument() {
     
    5657    }
    5758
     59    //TODO CLARIN-type search resources (CQL endpoints) are not dealth with yet.
     60    //You can use this method to get the list and add it to the solr somehow :)
     61    public List<Resource> getSearchResources() {
     62        return searchResources;
     63    }
     64
    5865    public void addResource(String resource, String type, String mimeType) {
    5966        if (METADATA_TYPE.equals(type)) {
    60             metaDataResources.add(new Resource(resource, mimeType));
     67            metaDataResources.add(new Resource(resource,type, mimeType));
    6168        } else if (DATA_RESOURCE_TYPE.equals(type)) {
    62             dataResources.add(new Resource(resource, mimeType));
     69            dataResources.add(new Resource(resource,type, mimeType));
     70        }else if (SEARCH_SERVICE_TYPE.equals(type)){
     71            searchResources.add(new Resource(resource,type, mimeType));
    6372        } else {
    6473            LOG.warn("Found unsupported resource it will be ignored: type=" + type + ", name=" + resource);
  • vlo/trunk/vlo_webapp/src/main/java/eu/clarin/cmdi/vlo/importer/Resource.java

    r1007 r2368  
    55    private final String resourceName;
    66    private final String mimeType;
     7    private final String type;
    78
    8     public Resource(String resourceName, String mimeType) {
     9    public Resource(String resourceName,String type, String mimeType) {
    910        this.resourceName = resourceName;
    1011        this.mimeType = mimeType == "" ? null : mimeType;
     12        this.type = type;
    1113    }
    1214
     
    1921    }
    2022
     23    public String getType(){
     24        return type;
     25    }
     26
    2127}
Note: See TracChangeset for help on using the changeset viewer.