Changeset 2677
- Timestamp:
- 03/12/13 13:44:04 (11 years ago)
- Location:
- vlo/branches/vlo-2.13-param
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/branches/vlo-2.13-param/vlo_importer/nbactions.xml
r2641 r2677 8 8 </goals> 9 9 <properties> 10 <exec.args>- classpath %classpath eu.clarin.cmdi.vlo.importer.MetadataImporter -c /Users/keeloo/VloConfig.xml</exec.args>10 <exec.args>-DconfigFile=/Users/keeloo/VloConfig.xml -classpath %classpath eu.clarin.cmdi.vlo.importer.MetadataImporter</exec.args> 11 11 <exec.executable>java</exec.executable> 12 12 <exec.classpathScope>runtime</exec.classpathScope> … … 20 20 </goals> 21 21 <properties> 22 <exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} - classpath %classpath eu.clarin.cmdi.vlo.importer.MetadataImporter -c /Users/keeloo/VloConfig.xml</exec.args>22 <exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -DconfigFile=/Users/keeloo/VloConfig.xml -classpath %classpath eu.clarin.cmdi.vlo.importer.MetadataImporter</exec.args> 23 23 <exec.executable>java</exec.executable> 24 24 <exec.classpathScope>runtime</exec.classpathScope> … … 33 33 </goals> 34 34 <properties> 35 <exec.args>${profiler.args} - classpath %classpath eu.clarin.cmdi.vlo.importer.MetadataImporter -c /Users/keeloo/VloConfig.xml</exec.args>35 <exec.args>${profiler.args} -DconfigFile=/Users/keeloo/VloConfig.xml -classpath %classpath eu.clarin.cmdi.vlo.importer.MetadataImporter</exec.args> 36 36 <exec.executable>${profiler.java}</exec.executable> 37 37 </properties> -
vlo/branches/vlo-2.13-param/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/config/DataRoot.java
r2663 r2677 7 7 8 8 /** 9 * Description of the location from which the importer collects meta data.9 * A dataRoot describes the met data sources. 10 10 * 11 * In an XML file, a dataRoot is reflected like this:<br><br> 12 * 13 * {@literal <DataRoot>} 14 * {@literal<originName>}name{@literal</originName>} 15 * {@literal<rootFile>}topLevelMetadataDirectory/{@literal</rootFile>} 16 * {@literal<prefix>}startOfUrl{@literal</prefix>} 17 * {@literal<tostrip>}leftPartOfRootFile{@literal</tostrip>} 18 * {@literal<deleteFirst>}falseOrTrue{@literal</deleteFirst>} 19 * {@literal</DataRoot>} 20 * 11 21 * @author keeloo 12 22 */ … … 23 33 * Constructor method 24 34 * 25 * @param originName 26 * @param rootFile 27 * @param prefix 28 * @param toStrip 35 * @param originName name describing the meta data 36 * @param rootFile top level directory in which the meta data is stored 37 * @param prefix left part of the rootFile 38 * @param toStrip if you want to create the URL to the meta data, this is 39 * the part to be removed from the rootFile 29 40 * @param deleteFirst 30 41 */ … … 38 49 39 50 /** 40 * 51 * Test for equality of the object itself and the object passed to it 52 * 41 53 * @param dataRoot 42 * @return 54 * @return true if the object equals this, false otherwise 43 55 */ 44 56 @Override … … 64 76 } 65 77 78 /** 79 * Generate by the ide 80 * 81 * @return hash code 82 */ 66 83 @Override 67 84 public int hashCode() { … … 76 93 77 94 /** 78 * Label of the data root. For example 79 * 80 * "MPI CMDIfied IMDI archive" 81 * 82 * or 83 * 84 * "LRT Inventory" 85 * 86 * The originName label can be used to reference the records the 87 * importer has submitted to the SOLR server. 95 * name describing the meta data 88 96 */ 89 97 @Element // Simple directive … … 91 99 92 100 /** 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. 97 * 98 * Example: 99 * 100 * /lat/apache/htdocs/oai-harvester/mpi-self-harvest/harvested/results/cmdi/ 101 * 102 * Normally, rootFile resides under a web server. 101 * top level directory in which the meta data is stored 103 102 */ 104 103 @Element … … 114 113 115 114 /** 116 * Filesystem equivalent of the prefix. For example: 117 * 118 * http://catalog.clarin.eu/ 119 * 120 * If you remove toStrip from rootFile, and append the result to the prefix, 121 * you get the URL at which the importer looks for files. In the case of the 122 * examples this would be the result: 123 * 124 * http://catalog.clarin.eu/oai-harvester/mpi-self-harvest/harvested/results/cmdi/ 115 * Left part of the rootFile 116 * 117 * By first removing {@literal tostrip} from {@literal rootFile} and then 118 * append the result of that operation to the {@literal prefix} you obtain 119 * the URL to the meta data. 125 120 */ 126 121 @Element 127 private String tostrip; // refactor this to toStrip 128 129 /** 130 * Flag to signal the removal of records SOLR server. This flag overrides 131 * the flag in the VLOConfig class. The deleteFirst flag controls the 122 private String tostrip; 123 124 /** 125 * Flag to signal the removal of records from the Solr server 126 * 127 * The value of this flag overrides the value defined in the {@lieteral 128 * VloConfig.xml} file. With the deleteFirst flag you can control the 132 129 * removal of the records originating from originName. 133 130 */ … … 135 132 private boolean deleteFirst = false; 136 133 134 /** 135 * Get the value of the prefix element<br><br> 136 * 137 * For a description of the element, refer to the general VLO 138 * documentation. 139 * 140 * @return the value 141 */ 137 142 public String getPrefix() { 138 143 return prefix; 139 144 } 140 145 146 /** 147 * Set the value of the prefix element<br><br> 148 * 149 * For a description of the element, refer to the general VLO 150 * documentation. 151 * 152 * @param prefix the value 153 */ 141 154 public void setPrefix(String prefix) { 142 155 this.prefix = prefix; 143 156 } 144 157 145 public String getTostrip() { 158 /** 159 * Get the value of the {@literal tostrip} element<br><br> 160 * 161 * For a description of the element, refer to the general VLO 162 * documentation. 163 * 164 * @return the value 165 */ 166 public String getToStrip() { 146 167 return tostrip; 147 168 } 148 169 170 /** 171 * Set the value of the {@literal tostrip} element<br><br> 172 * 173 * For a description of the element, refer to the general VLO 174 * documentation. 175 * 176 * @param tostrip the value 177 */ 149 178 public void setTostrip(String tostrip) { 150 179 this.tostrip = tostrip; 151 180 } 152 181 182 /** 183 * Get the value of the originName element<br><br> 184 * 185 * For a description of the element, refer to the general VLO 186 * documentation. 187 * 188 * @return the value 189 */ 153 190 public String getOriginName() { 154 191 return originName; 155 192 } 156 193 194 /** 195 * Set the value of the originName element<br><br> 196 * 197 * For a description of the element, refer to the general VLO 198 * documentation. 199 * 200 * @param originName the value 201 */ 157 202 public void setOriginName(String originName) { 158 203 this.originName = originName; 159 204 } 160 205 206 /** 207 * Get the value of the rootFile element<br><br> 208 * 209 * For a description of the element, refer to the general VLO 210 * documentation. 211 * 212 * @return the value 213 */ 161 214 public File getRootFile() { 162 215 return rootFile; 163 216 } 164 217 218 /** 219 * Set the value of the rootFile element<br><br> 220 * 221 * For a description of the element, refer to the general VLO 222 * documentation. 223 * 224 * @param rootFile the value 225 */ 165 226 public void setRootFile(File rootFile) { 166 227 this.rootFile = rootFile; 167 228 } 168 229 230 /** 231 * Set the value of the deleteFirst element<br><br> 232 * 233 * For a description of the element, refer to the general VLO 234 * documentation. 235 * 236 * @param deleteFirst the value 237 */ 169 238 public void setDeleteFirst(boolean deleteFirst) { 170 239 this.deleteFirst = deleteFirst; 171 240 } 172 241 173 public boolean isDeleteFirst() { 242 /** 243 * Get the value of the deleteFirst element<br><br> 244 * 245 * For a description of the element, refer to the general VLO 246 * documentation. 247 * 248 * @return the value 249 */ 250 public boolean deleteFirst() { 174 251 return deleteFirst; 175 252 } -
vlo/branches/vlo-2.13-param/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/config/VloConfig.java
r2663 r2677 10 10 import org.slf4j.LoggerFactory; 11 11 12 13 /**14 15 */16 17 12 /** 18 13 * VLO configuration<br><br> 19 14 * 20 15 * The annotated members in this class are the parameters by means of which 21 * you can configure a VLO application like for example the VLO importer or 22 * the VLO web application. 23 * 24 * A member is annotated by prepending {@literal @element}. When the VloConfig 25 * class is reflected into the Simple framework, the framework will assign the 26 * values it finds in the VloConfig.xml file to the members in the VloConfig 27 * class. 16 * you can configure a VLO application. 17 * 18 * A member is annotated by prepending {@literal @element} to it. When the 19 * VloConfig class is reflected into the Simple framework, the framework will 20 * assign the values it finds in the {@literal VloConfig.xml} file to the 21 * members in the VloConfig class. 28 22 * 29 23 * Whenever you need to add a parameter the VLO configuration, add a member … … 31 25 * declaration, like this: 32 26 * 33 * {@literal @element}<br> {@literal parameterMember}<br><br> 27 * {@literal @element}<br><br> 28 * {@literal parameterMember}<br><br> 34 29 * 35 30 * The XML should in this case contain a definition like … … 40 35 * If you want to add a type of member that is not included in VloConfig class 41 36 * yet, or if you are looking for more information on the framework, please 42 * refer to <url><br><br>37 * refer to VLO documentation.<br><br> 43 38 * 44 39 * In the VloConfig class, the parameters are stored statically. This means that … … 51 46 * {@literal WebAppConfig.getSomeParameter();}<br><br> 52 47 * 53 * in any scope, also the scope from which the read message was send. 54 * 55 * 56 * 57 * Move the following remarks to a general remark in the class description, a 58 * remark indicating what you could do if you do not want to use the packaged 59 * configuration. 60 * 61 * 62 * Here, modifications of the parameters inspired on the difference 63 * in context can be made. 64 * 65 * A web application can serve as a typical example of a difference in context: 66 * the application itself runs in a web server container, while the tests 67 * associated with the web application will be run outside this container. * 68 * 69 * 48 * in any scope, also a scope different from the one in which the read message 49 * was send. 70 50 * 71 51 * Through the get and set methods, the application is indifferent to the origin … … 285 265 } 286 266 287 267 /** 288 268 * Set the value of the deleteAllFirst parameter<br><br> 289 269 * … … 363 343 * documentation. 364 344 * 365 * @param url the parameter345 * @param url the value 366 346 */ 367 347 public static void setSolrUrl(String param) { -
vlo/branches/vlo-2.13-param/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/importer/MetadataImporter.java
r2668 r2677 123 123 for (DataRoot dataRoot : dataRoots) { 124 124 LOG.info("Start of processing: " + dataRoot.getOriginName()); 125 if (dataRoot. isDeleteFirst()) {125 if (dataRoot.deleteFirst()) { 126 126 LOG.info("Deleting data for data provider: " + dataRoot.getOriginName()); 127 127 solrServer.deleteByQuery(FacetConstants.FIELD_DATA_PROVIDER + ":" + ClientUtils.escapeQueryChars(dataRoot.getOriginName())); … … 291 291 //System.out.println(dataOrigin.getTostrip().length()); 292 292 //System.out.println(file.getAbsolutePath()); 293 metadataSourceUrl += file.getAbsolutePath().substring(dataOrigin.getTo strip().length());293 metadataSourceUrl += file.getAbsolutePath().substring(dataOrigin.getToStrip().length()); 294 294 295 295 solrDocument.addField(FacetConstants.FIELD_COMPLETE_METADATA, metadataSourceUrl); … … 413 413 LOG.error(message); 414 414 System.err.println(message); 415 } 416 417 if (configFile == null){ 418 419 String message; 420 421 message = "Could not get configuration file name via the command line."; 422 LOG.error(message); 415 423 416 424 String key; 425 417 426 key = "configFile"; 418 427 configFile = System.getProperty(key); 419 428 } 420 429 421 430 if (configFile == null) { 422 431 423 432 String message; 424 433 425 message = "Could not get filename as system property either .";434 message = "Could not get filename as system property either - stopping."; 426 435 LOG.error(message); 427 System.err.println(message);428 436 } else { 429 437 // read the configuration from the externally supplied file -
vlo/branches/vlo-2.13-param/vlo_solr/src/main/webapp/META-INF/context.xml
r2628 r2677 1 1 <?xml version="1.0" encoding="utf-8"?> 2 2 3 <!-- Solr context file4 3 5 solr/home : the directory in which the solr server will store it's data 4 <!-- Solr server context file 5 6 path : solr server context path. If u is the url of the web server, the solr 7 server will be reachable at u/path 8 9 solr/home : the top level directory which is created on unpacking the solr 10 server war file. The solr server will store it's data in the tree starting at 11 this directory. 6 12 7 13 Please refer to http://wiki.apache.org/solr for more information on how the 8 solr server should be configured. The war should be unpacked in the docBase 9 directory. 14 solr server should be configured. 10 15 11 16 --> 17 18 12 19 13 20 <Context path="/vlo_solr" debug="0" crossContext="true"> -
vlo/branches/vlo-2.13-param/vlo_web_app/src/main/webapp/META-INF/context.xml
r2641 r2677 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 3 <!-- VLO application context file 3 4 4 explain about how the configurtion works 5 path : web application context path. If u is the url of the web server, the web 6 application will be reachable at u/path 7 8 externalConfig : the path to an external configuration file. In this file you 9 can set the value of the VLO parameters. 10 11 The specification of an external configuration file is optional. If you do not 12 specify one, the VLO web application will use the packaged parameters. This will 13 only be usefull when the application is run from within a development 14 environment. 15 16 In a VLO configuration file, among others, you need to define the value of the 17 solrUrl parameter. You can override this value by defining it in the context 18 fragement directly. This is not obligatory however. 19 20 For more information on the meaning and purpose of the VLO parameters, please 21 refer to the documentation. 5 22 6 23 -->
Note: See TracChangeset
for help on using the changeset viewer.