Project

General

Profile

« Previous | Next » 

Revision 0f8489d7

Added by Andreas Müller almost 10 years ago

removed some destinations

View differences:

app-import/src/main/java/eu/etaxonomy/cdm/app/common/CdmDestinations.java
86 86
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
87 87
		String cdmServer = "127.0.0.1";
88 88
		String cdmDB = "test";
89
		String cdmUserName = "edit";     //root on pesiimport2
89
		String cdmUserName = "root";     //root on pesiimport2
90 90
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
91 91
	}
92 92
	
......
377 377
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
378 378
	}
379 379

  
380
	public static ICdmDataSource local_cdm_edit_cichorieae_a(){
381
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
382
		String cdmServer = "127.0.0.1";
383
		String cdmDB = "cdm_edit_cichorieae_a";
384
		String cdmUserName = "edit";
385
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
386
	}
387

  
388
	public static ICdmDataSource cdm_edit_palmae_a(){
389
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
390
		String cdmServer = "192.168.2.10";
391
		String cdmDB = "cdm_edit_palmae_a";
392
		String cdmUserName = "edit";
393
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
394
	}
395

  
396 380
	public static ICdmDataSource cdm_edit_cichorieae_preview(){
397 381
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
398 382
		String cdmServer = "127.0.0.1";
......
411 395
		return makeDestination(dbType, cdmServer, cdmDB, port, cdmUserName, null);
412 396
	}
413 397

  
414
	public static ICdmDataSource cdm_edit_cichorieae_integration(){
415
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
416
		String cdmServer = "127.0.0.1";
417
		String cdmDB = "cdm_integration_cichorieae";
418
		String cdmUserName = "edit";
419
		int port = 13306;
420
		return makeDestination(dbType, cdmServer, cdmDB, port, cdmUserName, null);
421
	}
422

  
423
	public static ICdmDataSource cdm_edit_palmae_preview(){
398
	public static ICdmDataSource cdm_production_piB(String database){
424 399
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
425
		String cdmServer = "127.0.0.1";
426
		String cdmDB = "cdm_edit_palmae";
427
		String cdmUserName = "edit";
428
		int port = 13306;
429
		return makeDestination(dbType, cdmServer, cdmDB, port, cdmUserName, null);
430
	}
431

  
432
	public static ICdmDataSource cdm_edit_salvador(){
433
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
434
		String cdmServer = "192.168.2.10";
435
		String cdmDB = "cdm_edit_salvador";
436
		String cdmUserName = "edit";
437
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
438
	}
439

  
440
	public static ICdmDataSource cdm_import_salvador() {
441
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
442
		String cdmServer = "192.168.2.10";
443
		String cdmDB = "cdm_import_salvador";
400
		String cdmServer = "160.45.63.171";
401
		String cdmDB = "cdm_prodcution_" + database + "_pilot";
444 402
		String cdmUserName = "edit";
445 403
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
446 404
	}
447

  
448
	public static ICdmDataSource cdm_salvador_production() {
449
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
450
		String cdmServer = "192.168.2.10";
451
		String cdmDB = "salvador_cdm";
452
		String cdmUserName = "salvador";
453
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
454
	}
455

  
405
	
456 406
	/**
457 407
     * patricia
458 408
     */
app-import/src/main/java/eu/etaxonomy/cdm/app/proibiosphere/TaxonXImportLauncher.java
51 51
//    static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql();
52 52
    static final ICdmDataSource cdmDestination = CdmDestinations.localH2();
53 53
//  static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql_test();
54
//    static final ICdmDataSource cdmDestination = CdmDestinations.cdm_production_piB("piB_spiders");
54 55
 
55 56
    static final CHECK check = CHECK.IMPORT_WITHOUT_CHECK;
56 57
    
......
79 80

  
80 81
        String defaultClassification="Spiders";
81 82
        boolean alwaysUseDefaultClassification = true;
83
        
84
        boolean useOldUnparsedSynonymExtraction = false;
82 85

  
83 86
        
84 87
        
......
95 98
        loadTreatmentIfPresent(filterType,taxonList, documentMap);
96 99
//        loadTreatmentIfPresent(FilterType.MODS,modsList, documents,documentMap);
97 100

  
98
        TaxonXImportConfigurator taxonxImportConfigurator =null;
99 101
        CdmDefaultImport<TaxonXImportConfigurator> taxonImport = new CdmDefaultImport<TaxonXImportConfigurator>();
100 102

  
101 103
        ICdmDataSource destination = cdmDestination;
102
        taxonxImportConfigurator = prepareTaxonXImport(destination,reuseSecundum, secundum, tnomenclature, alwaysUseDefaultClassification);
103

  
104
        taxonxImportConfigurator.setImportClassificationName(defaultClassification);
104
        TaxonXImportConfigurator config = prepareTaxonXImport(destination,reuseSecundum, secundum, tnomenclature, alwaysUseDefaultClassification);
105
        config.setUseOldUnparsedSynonymExtraction(useOldUnparsedSynonymExtraction);
106
        
107
        config.setImportClassificationName(defaultClassification);
105 108
        log.info("Start import from  TaxonX Data");
106 109

  
107
        taxonxImportConfigurator.setLastImport(false);
110
        config.setLastImport(false);
108 111

  
109 112
        int j=0;
110 113
        for (String document : documentMap.keySet()){
......
115 118
                    System.out.println("START "+document+" "+i+" ("+(documentMap.get(document)).size()+"): "+source.getPath());
116 119
                    i++;
117 120
                    if (j==documentMap.keySet().size() && i==documentMap.get(document).size()) {
118
                        taxonxImportConfigurator.setLastImport(true);
121
                        config.setLastImport(true);
119 122
                    }
120
                    prepareReferenceAndSource(taxonxImportConfigurator,source);
123
                    prepareReferenceAndSource(config,source);
121 124
                     //   taxonxImportConfigurator.setTaxonReference(null);
122
                    taxonImport.invoke(taxonxImportConfigurator);
125
                    taxonImport.invoke(config);
123 126
                    log.info("End import from SpecimenData ("+ source.toString() + ")...");
124 127

  
125 128
                    //          //deduplicate
......
221 224
            e1.printStackTrace();
222 225
        }
223 226

  
224
        //        sourcesStr.add("/home/pkelbert/Documents/Proibiosphere/ChenopodiumXML/1362148061170_Chenopodium_K_hn_U_1993_tx.xml");
225

  
226 227
        //System.out.println(documents);
227 228
        for (String docId : docs.keySet()){
228 229
            List<String> treatments = new ArrayList<String>(new HashSet<String>(docs.get(docId)));
......
243 244
            //            log.info(pages);
244 245

  
245 246
            log.info("Document "+docId+" should have "+treatments.size()+" treatments");
246
            //don't test if all the treatments are really online, it should be working without problems now
247
//            int cnt=0;
248
//            if(treatments.size()<150){
249
//
250
//            for (String source:treatments){
251
//                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
252
//                DocumentBuilder builder;
253
//                URL url;
254
//
255
//                try {
256
//                    builder = factory.newDocumentBuilder();
257
//                    url = new URL(source.split("---")[3]);
258
//                    Object o = url.getContent();
259
//                    InputStream is = (InputStream) o;
260
//                    Document document = builder.parse(is);
261
//                    cnt++;
262
//                }catch(Exception e){
263
//                    //  e.printStackTrace();
264
//                    log.warn(e);
265
//                }
266
//            }
267
//            log.info("Document "+docId+" has "+cnt+" treatments available");
268
//            }
269
//            if(treatments.size() != cnt)
270
//            {
271
//                File file = new File("/home/pkelbert/Bureau/urlTaxonXToDoLater.txt");
272
//                FileWriter writer;
273
//                try {
274
//                    writer = new FileWriter(file ,true);
275
//                    writer.write(docId+"\n");
276
//                    writer.flush();
277
//                    writer.close();
278
//                } catch (IOException e1) {
279
//                    // TODO Auto-generated catch block
280
//                    e1.printStackTrace();
281
//                }
282
//
283
//            }
284
//            else{
285 247
                List<URI> uritmp = documentMap.get(docId);
286 248
                if (uritmp == null) {
287 249
                    uritmp = new ArrayList<URI>();
......
305 267

  
306 268

  
307 269

  
308
//        }
309
        //////        log.info("NB SOURCES : "+sourcesStr.size());
310
        //        List<URI> sourcesStr = new ArrayList<URI>();
311
        //        try {
312
        ////            documentMap = new HashMap<String, List<URI>>();
313
        //            sourcesStr.add(new URI("http://plazi.cs.umb.edu/GgServer/cdmSync/8F5B3EA099D371BC41CC5DDBFEDCFBED"));
314
        //            documentMap.put("singlesource", sourcesStr);
315
        //        } catch (URISyntaxException e) {
316
        //            // TODO Auto-generated catch block
317
        //            e.printStackTrace();
318
        //        }
270

  
319 271

  
320 272
        return documentMap;
321 273

  
app-import/src/main/java/eu/etaxonomy/cdm/app/sdd/CichorieaeActivator.java
41 41
	 * ALTER TABLE `statisticalmeasurementvalue_definedtermbase`  DROP INDEX `modifiers_id`;
42 42
	 * 
43 43
	 ********************************************************************************/
44
	static final ICdmDataSource cdmDestination = CdmDestinations.local_cdm_edit_cichorieae_a();
44
	static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql();
45 45
	static final String sddSource = SDDSources.Cichorieae_DA_export_sdd();
46 46
	//	static final ICdmDataSource cdmDestination = CdmDestinations.cdm_portal_test_localhost();
47 47

  

Also available in: Unified diff