- Timestamp:
- 04/04/13 14:09:29 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/trunk/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/importer/CMDIData.java
r2768 r2774 1 1 package eu.clarin.cmdi.vlo.importer; 2 2 3 import eu.clarin.cmdi.vlo.FacetConstants; 3 4 import java.util.ArrayList; 4 5 import java.util.Collection; 5 6 import java.util.List; 6 7 7 import org.apache.solr.common.SolrInputDocument; 8 8 import org.slf4j.Logger; 9 9 import org.slf4j.LoggerFactory; 10 11 import eu.clarin.cmdi.vlo.FacetConstants;12 10 13 11 /** … … 21 19 private static final String DATA_RESOURCE_TYPE = "Resource"; 22 20 private static final String SEARCH_SERVICE_TYPE = "SearchService"; 21 private static final String LANDING_PAGE_TYPE = "LandingPage"; 23 22 24 23 /** … … 26 25 */ 27 26 private String id; 27 28 28 /** 29 29 * The associated solr document (not send to the solr server yet) … … 35 35 private final List<Resource> dataResources = new ArrayList<Resource>(); 36 36 private final List<Resource> searchResources = new ArrayList<Resource>(); 37 private final List<Resource> landingPageResources = new ArrayList<Resource>(); 37 38 38 39 public SolrInputDocument getSolrDocument() { … … 41 42 42 43 /** 43 * Sets a field in the doc to a certain value. Well, at least calls another (private) method that actually does this. 44 * Sets a field in the doc to a certain value. Well, at least calls another 45 * (private) method that actually does this. 44 46 * @param name 45 47 * @param value … … 92 94 93 95 /** 94 * Processes a resource by adding it to the internal lists. 95 * Supports metadata, data, and search service type of resources. 96 * Emits a warning if another type of resource is encountered (not allowed according to the cmdi spec, but we try to be a tad robust). 96 * Return a list of landing page resources 97 */ 98 public List<Resource> getLandingPageResources() { 99 return landingPageResources; 100 } 101 102 /** 103 * Processes a resource by adding it to the internal lists. Supports meta 104 * data, data, search service and landing page type of resources. Emits a 105 * warning if another type of resource is encountered (not allowed according 106 * to the cmdi spec, but we try to be a tad robust). 107 * 97 108 * @param resource 98 109 * @param type … … 106 117 } else if (SEARCH_SERVICE_TYPE.equals(type)){ 107 118 searchResources.add(new Resource(resource,type, mimeType)); 119 } else if (LANDING_PAGE_TYPE.equals(type)){ 120 landingPageResources.add(new Resource(resource,type, mimeType)); 108 121 } else { 109 LOG.warn("Found unsupported resource it will be ignored: type=" + type + ", name=" + resource); 122 LOG.warn("Found unsupported resource it will be ignored: type=" + 123 type + ", name=" + resource); 110 124 } 111 125 } … … 118 132 return id; 119 133 } 120 121 134 }
Note: See TracChangeset
for help on using the changeset viewer.