Project

General

Profile

Download (3 KB) Statistics
| Branch: | Revision:
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.io.globis.validation;
11

    
12
import org.apache.log4j.Logger;
13

    
14
import eu.etaxonomy.cdm.io.common.IOValidator;
15
import eu.etaxonomy.cdm.io.globis.GlobisImportConfigurator;
16
import eu.etaxonomy.cdm.io.globis.GlobisImportState;
17

    
18
/**
19
 * @author a.mueller
20
 * @since 17.02.2010
21
 * @version 1.0
22
 */
23
public class GlobisSpecTaxaImportValidator implements IOValidator<GlobisImportState>{
24
	private static final Logger logger = Logger.getLogger(GlobisSpecTaxaImportValidator.class);
25

    
26
	public boolean validate(GlobisImportState state){
27
		boolean result = true;
28
		GlobisImportConfigurator config = state.getConfig();
29
		logger.warn("Checking for spec taxa not yet implemented");
30
//		result &= checkTaxonStatus(config);
31
//		result &= checkInactivated(config);
32
		return result;
33
	}
34
	
35
//	private boolean checkTaxonStatus(GlobisImportConfigurator bmiConfig){
36
//		try {
37
//			boolean result = true;
38
//			Source source = bmiConfig.getSource();
39
//			String strSQL = " SELECT RelPTaxon.RelQualifierFk, RelPTaxon.relPTaxonId, PTaxon.PTNameFk, PTaxon.PTRefFk, PTaxon_1.PTNameFk AS Expr1, PTaxon.RIdentifier, PTaxon_1.RIdentifier AS Expr3, Name.FullNameCache "  +
40
//				" FROM RelPTaxon " + 
41
//					" INNER JOIN PTaxon ON RelPTaxon.PTNameFk1 = PTaxon.PTNameFk AND RelPTaxon.PTRefFk1 = PTaxon.PTRefFk " + 
42
//					" INNER JOIN PTaxon AS PTaxon_1 ON RelPTaxon.PTNameFk2 = PTaxon_1.PTNameFk AND RelPTaxon.PTRefFk2 = PTaxon_1.PTRefFk  " + 
43
//					" INNER JOIN Name ON PTaxon.PTNameFk = Name.NameId " +
44
//				" WHERE (dbo.PTaxon.StatusFk = 1) AND ((RelPTaxon.RelQualifierFk = 7) OR (RelPTaxon.RelQualifierFk = 6) OR (RelPTaxon.RelQualifierFk = 2)) ";
45
//			ResultSet rs = source.getResultSet(strSQL);
46
//			boolean firstRow = true;
47
//			int i = 0;
48
//			while (rs.next()){
49
//				i++;
50
//				if (firstRow){
51
//					System.out.println("========================================================");
52
//					logger.warn("There are taxa that have a 'is synonym of' - relationship but having taxon status 'accepted'!");
53
//					System.out.println("========================================================");
54
//				}
55
//				int rIdentifier = rs.getInt("RIdentifier");
56
//				int nameFk = rs.getInt("PTNameFk");
57
//				int refFk = rs.getInt("PTRefFk");
58
//				int relPTaxonId = rs.getInt("relPTaxonId");
59
//				String taxonName = rs.getString("FullNameCache");
60
//				
61
//				System.out.println("RIdentifier:" + rIdentifier + "\n  name: " + nameFk + 
62
//						"\n  taxonName: " + taxonName + "\n  refId: " + refFk + "\n  RelPTaxonId: " + relPTaxonId );
63
//				result = firstRow = false;
64
//			}
65
//			if (i > 0){
66
//				System.out.println(" ");
67
//			}
68
//			
69
//			return result;
70
//		} catch (SQLException e) {
71
//			e.printStackTrace();
72
//			return false;
73
//		}
74
//	}
75
//
76

    
77

    
78
}
(4-4/4)