Project

General

Profile

« Previous | Next » 

Revision d7c7fd33

Added by Andreas Müller 4 months ago

cleanup CichorieaeFirstImageImportActivator and TaxonExcelCaryophyllales

View differences:

app-import/src/main/java/eu/etaxonomy/cdm/app/caryophyllales/TaxonExcelCaryophyllales.java
1
package eu.etaxonomy.cdm.app.caryophyllales;
2

  
3
import eu.etaxonomy.cdm.io.excel.taxa.NormalExplicitRow;
4
import eu.etaxonomy.cdm.io.excel.taxa.TaxonExcelImportBase;
5
import eu.etaxonomy.cdm.io.excel.taxa.TaxonExcelImportState;
6

  
7
public class TaxonExcelCaryophyllales extends TaxonExcelImportBase {
8
    private static final long serialVersionUID = 7516628978483172010L;
9
    protected static final String AUTHOR_COLUMN = "Authorship";
10
	protected static final String SPECIES_HYBRID_MARKER = "Species hybrid marker";
11
	protected static final String NAME_STATUS_COLUMN = "NameStatus";
12
	protected static final String VERNACULAR_NAME_COLUMN = "VernacularName";
13
	protected static final String LANGUAGE_COLUMN = "Language";
14
	protected static final String REFERENCE_COLUMN = "Reference";
15

  
16
	protected static final String PROTOLOGUE_COLUMN = "Protologue";
17
	protected static final String IMAGE_COLUMN = "Image";
18
	protected static final String TDWG_COLUMN = "TDWG";
19
	protected static final String COUNTRY_COLUMN = "Country";
20

  
21
	protected static final String SYNONYM_COLUMN = "Synonym";
22

  
23
	@Override
24
	protected NormalExplicitRow createDataHolderRow() {
25
		// TODO Auto-generated method stub
26
		return null;
27
	}
28

  
29
	@Override
30
	protected void analyzeSingleValue(
31
			eu.etaxonomy.cdm.io.excel.common.ExcelTaxonOrSpecimenImportBase.KeyValue keyValue,
32
			TaxonExcelImportState state) {
33
		// TODO Auto-generated method stub
34

  
35
	}
36

  
37
	@Override
38
	protected void firstPass(TaxonExcelImportState state) {
39
		// TODO Auto-generated method stub
40

  
41
	}
42

  
43
	@Override
44
	protected void secondPass(TaxonExcelImportState state) {
45
		// TODO Auto-generated method stub
46

  
47
	}
48

  
49
	@Override
50
	protected boolean isIgnore(TaxonExcelImportState state) {
51
		// TODO Auto-generated method stub
52
		return false;
53
	}
54

  
55
}
app-import/src/main/java/eu/etaxonomy/cdm/app/wp6/cichorieae/CichorieaeFirstImageImportActivator.java
1
/**
2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy 
4
* http://www.e-taxonomy.eu
5
* 
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9

  
10
package eu.etaxonomy.cdm.app.wp6.cichorieae;
11

  
12
import eu.etaxonomy.cdm.common.URI;
13
import java.net.URISyntaxException;
14
import java.util.UUID;
15

  
16
import org.apache.log4j.Logger;
17

  
18
import eu.etaxonomy.cdm.app.common.CdmDestinations;
19
import eu.etaxonomy.cdm.app.images.ImageImportConfigurator;
20
import eu.etaxonomy.cdm.database.ICdmDataSource;
21
import eu.etaxonomy.cdm.io.common.CdmDefaultImport;
22
import eu.etaxonomy.cdm.io.common.IImportConfigurator;
23
import eu.etaxonomy.cdm.io.wp6.CichorieaeImageImport;
24

  
25
/**
26
 * @author n.hoffmann
27
 * @since 18.11.2008
28
 * @version 1.0
29
 */
30
public class CichorieaeImageActivator  {
31
	@SuppressWarnings("unused")
32
	private static final Logger logger = Logger.getLogger(CichorieaeImageActivator.class);
33
	
34
	//	private static final File sourceFile = new File("src/main/resources/images/images_cich.xls");
35
	private static final ICdmDataSource cdmDestination = CdmDestinations.localH2Cichorieae();
36
//	private static final ICdmDataSource cdmDestination = CdmDestinations.cdm_import_cichorieae();
37
	
38
	static final UUID secUuid = UUID.fromString("6924c75d-e0d0-4a6d-afb7-3dd8c71195ca");
39
//	static final UUID treeUuid = UUID.fromString("00db28a7-50e1-4abc-86ec-b2a8ce870de9");
40
	static final UUID treeUuid = UUID.fromString("534e190f-3339-49ba-95d9-fa27d5493e3e");
41
	
42
	public static void main (String[] cowabunga){
43
		
44
		ICdmDataSource destination = CdmDestinations.chooseDestination(cowabunga) != null ? CdmDestinations.chooseDestination(cowabunga) : cdmDestination;
45
		
46
		URI imageFolderCichorieae;
47
		try {
48
			imageFolderCichorieae = new URI (CichorieaeActivator.imageFolderString);
49
			ImageImportConfigurator imageConfigurator = ImageImportConfigurator.NewInstance(
50
					imageFolderCichorieae, destination, CichorieaeImageImport.class);
51
			imageConfigurator.setSecUuid(secUuid);
52
			imageConfigurator.setClassificationUuid(treeUuid);
53
			
54
			CdmDefaultImport<IImportConfigurator> importer = new CdmDefaultImport<IImportConfigurator>();
55
			importer.invoke(imageConfigurator);
56
		} catch (URISyntaxException e) {
57
			e.printStackTrace();
58
		}
59
	}
60
}
app-import/src/main/java/eu/etaxonomy/cdm/app/wp6/cichorieae/CichorieaeImageActivator.java
1
/**
2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy 
4
* http://www.e-taxonomy.eu
5
* 
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9

  
10
package eu.etaxonomy.cdm.app.wp6.cichorieae;
11

  
12
import eu.etaxonomy.cdm.common.URI;
13
import java.net.URISyntaxException;
14
import java.util.UUID;
15

  
16
import org.apache.log4j.Logger;
17

  
18
import eu.etaxonomy.cdm.app.common.CdmDestinations;
19
import eu.etaxonomy.cdm.app.images.ImageImportConfigurator;
20
import eu.etaxonomy.cdm.database.ICdmDataSource;
21
import eu.etaxonomy.cdm.io.common.CdmDefaultImport;
22
import eu.etaxonomy.cdm.io.common.IImportConfigurator;
23
import eu.etaxonomy.cdm.io.wp6.CichorieaeImageImport;
24

  
25
/**
26
 * @author n.hoffmann
27
 * @since 18.11.2008
28
 * @version 1.0
29
 */
30
public class CichorieaeImageActivator  {
31
	@SuppressWarnings("unused")
32
	private static final Logger logger = Logger.getLogger(CichorieaeImageActivator.class);
33
	
34
	//	private static final File sourceFile = new File("src/main/resources/images/images_cich.xls");
35
	private static final ICdmDataSource cdmDestination = CdmDestinations.localH2Cichorieae();
36
//	private static final ICdmDataSource cdmDestination = CdmDestinations.cdm_import_cichorieae();
37
	
38
	static final UUID secUuid = UUID.fromString("6924c75d-e0d0-4a6d-afb7-3dd8c71195ca");
39
//	static final UUID treeUuid = UUID.fromString("00db28a7-50e1-4abc-86ec-b2a8ce870de9");
40
	static final UUID treeUuid = UUID.fromString("534e190f-3339-49ba-95d9-fa27d5493e3e");
41
	
42
	public static void main (String[] cowabunga){
43
		
44
		ICdmDataSource destination = CdmDestinations.chooseDestination(cowabunga) != null ? CdmDestinations.chooseDestination(cowabunga) : cdmDestination;
45
		
46
		URI imageFolderCichorieae;
47
		try {
48
			imageFolderCichorieae = new URI (CichorieaeActivator.imageFolderString);
49
			ImageImportConfigurator imageConfigurator = ImageImportConfigurator.NewInstance(
50
					imageFolderCichorieae, destination, CichorieaeImageImport.class);
51
			imageConfigurator.setSecUuid(secUuid);
52
			imageConfigurator.setClassificationUuid(treeUuid);
53
			
54
			CdmDefaultImport<IImportConfigurator> importer = new CdmDefaultImport<IImportConfigurator>();
55
			importer.invoke(imageConfigurator);
56
		} catch (URISyntaxException e) {
57
			e.printStackTrace();
58
		}
59
	}
60
}

Also available in: Unified diff