Changeset 6386
- Timestamp:
- 07/14/15 09:42:13 (9 years ago)
- Location:
- vlo/branches/vlo-3.3-oeaw/vlo-importer/src/main/java/eu/clarin/cmdi/vlo/importer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/branches/vlo-3.3-oeaw/vlo-importer/src/main/java/eu/clarin/cmdi/vlo/importer/CMDIData.java
r2828 r6386 2 2 3 3 import eu.clarin.cmdi.vlo.FacetConstants; 4 4 5 import java.util.ArrayList; 5 6 import java.util.Collection; 6 7 import java.util.List; 8 7 9 import org.apache.solr.common.SolrInputDocument; 8 10 import org.slf4j.Logger; … … 38 40 private final List<Resource> landingPageResources = new ArrayList<Resource>(); 39 41 private final List<Resource> searchPageResources = new ArrayList<Resource>(); 42 43 private String profileId; 44 private String profileName; 40 45 41 46 public SolrInputDocument getSolrDocument() { … … 147 152 return id; 148 153 } 154 155 public void setProfileId(String profileId) { 156 this.profileId = profileId; 157 158 } 159 160 public String getProfileId() { 161 return profileId; 162 } 163 164 public String getProfileName() { 165 return profileName; 166 } 167 168 public void setProfileName(String profileName) { 169 this.profileName = profileName; 170 } 171 172 149 173 } -
vlo/branches/vlo-3.3-oeaw/vlo-importer/src/main/java/eu/clarin/cmdi/vlo/importer/CMDIParserVTDXML.java
r6311 r6386 46 46 47 47 VTDNav nav = vg.getNav(); 48 FacetMapping facetMapping = getFacetMapping(nav.cloneNav()); 48 String profileId = extractXsd(nav.cloneNav()); 49 cmdiData.setProfileId(profileId); 50 FacetMapping facetMapping = getFacetMapping(profileId); 49 51 50 52 if (facetMapping.getFacets().isEmpty()) { … … 52 54 } 53 55 56 List<String> profileName = (postProcessors.get(FacetConstants.FIELD_CLARIN_PROFILE)).process(profileId); 57 cmdiData.setProfileName(profileName.get(0)); 54 58 nav.toElement(VTDNav.ROOT); 55 59 processResources(cmdiData, nav); … … 74 78 * @throws VTDException 75 79 */ 76 private FacetMapping getFacetMapping(VTDNav nav) throws VTDException { 77 String profileId = extractXsd(nav); 80 private FacetMapping getFacetMapping(String profileId) throws VTDException { 78 81 if (profileId == null) { 79 82 throw new RuntimeException("Cannot get xsd schema so cannot get a proper mapping. Parse failed!"); -
vlo/branches/vlo-3.3-oeaw/vlo-importer/src/main/java/eu/clarin/cmdi/vlo/importer/MetadataImporter.java
r6354 r6386 433 433 addResourceData(solrDocument, cmdiData); 434 434 435 436 //Add profileId & profileName 437 solrDocument.addField("profileName", cmdiData.getProfileName()); 438 solrDocument.addField("profileId", cmdiData.getProfileId()); 439 440 441 //Add missing facets with "null" val 442 for(String facet: config.getFacetFields()){ 443 if(!solrDocument.getFieldNames().contains(facet)) 444 solrDocument.addField(facet, "null"); 445 } 446 447 435 448 LOG.debug("Adding document for submission to SOLR: {}", file); 436 449 docs.add(solrDocument);
Note: See TracChangeset
for help on using the changeset viewer.