Changeset 2663
- Timestamp:
- 03/08/13 09:30:01 (11 years ago)
- Location:
- vlo/branches/vlo-2.13-param/vlo_importer
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/branches/vlo-2.13-param/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/config/DataRoot.java
r2570 r2663 7 7 8 8 /** 9 * Description of the location from which the i ngester collects meta data.9 * Description of the location from which the importer collects meta data. 10 10 * 11 11 * @author keeloo 12 12 */ 13 13 @Root // Simple directive 14 public class DataRoot { 14 public class DataRoot extends Object { 15 16 /** 17 * Constructor method 18 */ 19 public DataRoot (){ 20 } 21 22 /** 23 * Constructor method 24 * 25 * @param originName 26 * @param rootFile 27 * @param prefix 28 * @param toStrip 29 * @param deleteFirst 30 */ 31 public DataRoot(String originName, File rootFile, String prefix, String toStrip, Boolean deleteFirst) { 32 this.originName = originName; 33 this.rootFile = rootFile; 34 this.prefix = prefix; 35 this.tostrip = toStrip; 36 this.deleteFirst = deleteFirst; 37 } 38 39 /** 40 * 41 * @param dataRoot 42 * @return 43 */ 44 @Override 45 public boolean equals (Object object){ 46 boolean equal = false; 47 48 if (object == null) { 49 // define this object to be different from nothing 50 } else { 51 if (! (object instanceof DataRoot)) { 52 // the object is not a DataRoot, define it not to be equal 53 } else { 54 equal = this.originName.equals(((DataRoot) object).originName); 55 equal = this.rootFile.equals(((DataRoot) object).rootFile) && equal; 56 equal = this.prefix.equals(((DataRoot) object).prefix) && equal; 57 equal = this.tostrip.equals(((DataRoot) object).tostrip) && equal; 58 59 equal = this.deleteFirst == ((DataRoot) object).deleteFirst && equal; 60 } 61 } 62 63 return equal; 64 } 65 66 @Override 67 public int hashCode() { 68 int hash = 7; 69 hash = 29 * hash + (this.originName != null ? this.originName.hashCode() : 0); 70 hash = 29 * hash + (this.rootFile != null ? this.rootFile.hashCode() : 0); 71 hash = 29 * hash + (this.prefix != null ? this.prefix.hashCode() : 0); 72 hash = 29 * hash + (this.tostrip != null ? this.tostrip.hashCode() : 0); 73 hash = 29 * hash + (this.deleteFirst ? 1 : 0); 74 return hash; 75 } 15 76 16 77 /** … … 24 85 * 25 86 * The originName label can be used to reference the records the 26 * i ngester has submitted to the SOLR server.87 * importer has submitted to the SOLR server. 27 88 */ 28 89 @Element // Simple directive … … 30 91 31 92 /** 32 * Meta data to be i ngested. The rootFile can take the form of a root CMDI33 * file, a file for which the i ngester will follow the links defined in it.34 * It can also be a directory with .xml and or .cmdi files to be i ngested.35 * The i ngester will process the directories recursively.93 * Meta data to be imported. The rootFile can take the form of a root CMDI 94 * file, a file for which the importer will follow the links defined in it. 95 * It can also be a directory with .xml and or .cmdi files to be imported. 96 * The importer will process the directories recursively. 36 97 * 37 98 * Example: … … 58 119 * 59 120 * If you remove toStrip from rootFile, and append the result to the prefix, 60 * you get the URL at which the i ngester looks for files. In the case of the121 * you get the URL at which the importer looks for files. In the case of the 61 122 * examples this would be the result: 62 123 * … … 73 134 @Element 74 135 private boolean deleteFirst = false; 75 76 77 /**78 * Remove the get and set methods declared below one by one.79 */80 136 81 137 public String getPrefix() { -
vlo/branches/vlo-2.13-param/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/config/VloConfig.java
r2661 r2663 274 274 275 275 /** 276 * Get the value of the deleteAllFirst parameter<br><br> 277 * 278 * For a description of the parameter, refer to the general VLO 279 * documentation. 280 * 281 * @return the value 282 */ 283 public static boolean deleteAllFirst() { 284 return deleteAllFirst; 285 } 286 287 /** 276 288 * Set the value of the deleteAllFirst parameter<br><br> 277 289 * … … 286 298 287 299 /** 288 * Get the value of the deleteAllFirstparameter<br><br>289 * 290 * For a description of the parameter, refer to the general VLO 291 * documentation. 292 * 293 * @return the value 294 */ 295 public static boolean isDeleteAllFirst() {296 return deleteAllFirst;297 } 298 300 * Get the value of the printMapping parameter<br><br> 301 * 302 * For a description of the parameter, refer to the general VLO 303 * documentation. 304 * 305 * @return the value 306 */ 307 public static boolean printMapping() { 308 return printMapping; 309 } 310 299 311 /** 300 312 * Set the value of the printMapping parameter<br><br> … … 309 321 } 310 322 311 /**312 * Get the value of the printMapping parameter<br><br>313 *314 * For a description of the parameter, refer to the general VLO315 * documentation.316 *317 * @return the value318 */319 public static boolean isPrintMapping() {320 return printMapping;321 }322 323 323 /** 324 324 * Get the value of the VloHomeLink parameter<br><br> -
vlo/branches/vlo-2.13-param/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/importer/MetadataImporter.java
r2660 r2663 115 115 try { 116 116 // Delete the whole Solr db 117 if (VloConfig. isDeleteAllFirst()) {117 if (VloConfig.deleteAllFirst()) { 118 118 LOG.info("Deleting original data..."); 119 119 solrServer.deleteByQuery("*:*"); … … 412 412 // finished importing 413 413 414 if (VloConfig. isPrintMapping()) {414 if (VloConfig.printMapping()) { 415 415 File file = new File("xsdMapping.txt"); 416 416 FacetMappingFactory.printMapping(file); -
vlo/branches/vlo-2.13-param/vlo_importer/src/main/resources/VloConfig.xml
r2657 r2663 31 31 </dataRoots> 32 32 33 <vloHomeLink>http://www.clarin.eu/vlo</vloHomeLink> 34 33 35 <solrUrl>http://localhost:8084/vlo_solr/</solrUrl> 34 35 <vloHomeLink>http://www.clarin.eu/vlo</vloHomeLink>36 36 37 37 <profileSchemaUrl>http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/profiles/{PROFILE_ID}/xsd</profileSchemaUrl> -
vlo/branches/vlo-2.13-param/vlo_importer/xsdMapping.txt
r2661 r2663 1 This file is generated on Mar 7, 2013 12:22:39 PM and only used to document the mapping.1 This file is generated on Mar 8, 2013 10:12:39 AM and only used to document the mapping. 2 2 This file contains xsd name and a list of conceptName with xpath mappings that are generated. 3 3 --------------------- 4 http://www.openarchives.org/OAI/2.0/oai_dc.xsd5 FacetName:id6 Mappings:7 /c:CMD/c:Header/c:MdSelfLink/text()8 FacetName:collection9 Mappings:10 /c:CMD/c:Header/c:MdCollectionDisplayName/text()11 FacetName:name12 Mappings:13 /c:CMD/c:Components/c:LrtInventoryResource/c:LrtCommon/c:ResourceName/text()14 FacetName:country15 Mappings:16 /c:CMD/c:Components/c:OLAC-DcmiTerms/c:spatial[@dcterms-type="ISO3166"]/text()17 /c:CMD/c:Components/c:OLAC-DcmiTerms/c:coverage[@dcterms-type="ISO3166"]/text()18 FacetName:language19 Mappings:20 /c:CMD/c:Components/c:OLAC-DcmiTerms/c:language/@olac-language21 /c:CMD/c:Components/c:OLAC-DcmiTerms/c:subject/@olac-language22 /c:CMD/c:Components/c:LrtInventoryResource/c:LrtCommon/c:Languages/c:ISO639/c:iso-639-3-code/text()23 FacetName:languages24 Mappings:25 /c:CMD/c:Components/c:OLAC-DcmiTerms/c:language/@olac-language26 /c:CMD/c:Components/c:OLAC-DcmiTerms/c:subject/@olac-language27 /c:CMD/c:Components/c:LrtInventoryResource/c:LrtCommon/c:Languages/c:ISO639/c:iso-639-3-code/text()28 FacetName:genre29 Mappings:30 /c:CMD/c:Components/c:OLAC-DcmiTerms/c:type/@olac-linguistic-type31 FacetName:subject32 Mappings:33 /c:CMD/c:Components/c:OLAC-DcmiTerms/c:subject/@olac-linguistic-field34 /c:CMD/c:Components/c:OLAC-DcmiTerms/c:subject[@dcterms-type="LCSH"]/text()35 FacetName:resourceType36 Mappings:37 /c:CMD/c:Components/c:LrtInventoryResource/c:LrtCommon/c:ResourceType/text()38 /c:CMD/c:Components/c:OLAC-DcmiTerms/c:type/text()39 FacetName:nationalProject40 Mappings:41 /c:CMD/c:Header/c:MdCollectionDisplayName/text()42 FacetName:text43 Mappings:44 /c:CMD//text()45 FacetName:_componentProfile46 Mappings:47 /c:CMD/c:Header/c:MdProfile/text()48 ---------------------
Note: See TracChangeset
for help on using the changeset viewer.