Changeset 2368
- Timestamp:
- 11/22/12 14:11:39 (12 years ago)
- 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 1 1 package eu.clarin.cmdi.vlo.importer; 2 3 import eu.clarin.cmdi.vlo.FacetConstants; 4 import org.apache.solr.common.SolrInputDocument; 5 import org.slf4j.Logger; 6 import org.slf4j.LoggerFactory; 2 7 3 8 import java.util.ArrayList; … … 5 10 import java.util.List; 6 11 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 13 12 public class CMDIData { 14 13 private final static Logger LOG = LoggerFactory.getLogger(CMDIData.class); 15 14 private static final String METADATA_TYPE = "Metadata"; 16 15 private static final String DATA_RESOURCE_TYPE = "Resource"; 16 private static final String SEARCH_SERVICE_TYPE = "SearchService"; 17 17 18 18 private String id; … … 20 20 private SolrInputDocument doc; 21 21 private List<Resource> dataResources = new ArrayList<Resource>(); 22 private List<Resource> searchResources = new ArrayList<Resource>(); 22 23 23 24 public SolrInputDocument getSolrDocument() { … … 56 57 } 57 58 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 58 65 public void addResource(String resource, String type, String mimeType) { 59 66 if (METADATA_TYPE.equals(type)) { 60 metaDataResources.add(new Resource(resource, mimeType));67 metaDataResources.add(new Resource(resource,type, mimeType)); 61 68 } 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)); 63 72 } else { 64 73 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 5 5 private final String resourceName; 6 6 private final String mimeType; 7 private final String type; 7 8 8 public Resource(String resourceName, String mimeType) {9 public Resource(String resourceName,String type, String mimeType) { 9 10 this.resourceName = resourceName; 10 11 this.mimeType = mimeType == "" ? null : mimeType; 12 this.type = type; 11 13 } 12 14 … … 19 21 } 20 22 23 public String getType(){ 24 return type; 25 } 26 21 27 }
Note: See TracChangeset
for help on using the changeset viewer.