Revision 7899fae3
Added by Andreas Müller over 6 years ago
app-import/src/main/java/eu/etaxonomy/cdm/app/salvador/TestSalvadorAreaMapping.java | ||
---|---|---|
30 | 30 |
* |
31 | 31 |
*/ |
32 | 32 |
public class TestSalvadorAreaMapping { |
33 |
@SuppressWarnings("unused") |
|
33 | 34 |
private static final Logger logger = Logger.getLogger(TestSalvadorAreaMapping.class); |
34 | 35 |
|
35 | 36 |
//database validation status (create, update, validate ...) |
... | ... | |
43 | 44 |
protected void doTest(ICdmDataSource cdmDestination){ |
44 | 45 |
|
45 | 46 |
CdmIoApplicationController app = CdmIoApplicationController.NewInstance(cdmDestination, hbm2dll); |
46 |
|
|
47 | 47 |
try { |
48 | 48 |
doTest2(app); |
49 | 49 |
} catch (Exception e) { |
50 |
// TODO Auto-generated catch block |
|
51 | 50 |
e.printStackTrace(); |
52 | 51 |
} |
53 |
|
|
54 | 52 |
} |
55 | 53 |
|
56 | 54 |
|
57 |
|
|
58 |
|
|
59 | 55 |
/** |
60 | 56 |
* @param app |
61 | 57 |
* @throws Exception |
... | ... | |
65 | 61 |
// Taxon taxon = (Taxon)app.getTaxonService().find(taxonUuid); |
66 | 62 |
Object geoServiceObj = app.getBean("editGeoService"); |
67 | 63 |
EditGeoService geoService; |
68 |
try { |
|
69 |
geoService = getTargetObject(geoServiceObj); |
|
64 |
try {
|
|
65 |
geoService = getTargetObject(geoServiceObj);
|
|
70 | 66 |
|
71 | 67 |
|
72 |
Set<InfoPart> partSet = new HashSet<>(); |
|
73 |
partSet.add(InfoPart.mapUriParams); |
|
68 |
Set<InfoPart> partSet = new HashSet<>();
|
|
69 |
partSet.add(InfoPart.mapUriParams);
|
|
74 | 70 |
|
75 |
EnumSet<InfoPart> parts = EnumSet.copyOf(partSet); |
|
76 |
geoService.composeDistributionInfoFor(parts, taxonUuid, false, false, null, null, null, null, null, null, null); |
|
77 |
} catch (Exception e) { |
|
78 |
// TODO Auto-generated catch block |
|
79 |
e.printStackTrace(); |
|
80 |
} |
|
71 |
EnumSet<InfoPart> parts = EnumSet.copyOf(partSet); |
|
72 |
geoService.composeDistributionInfoFor(parts, taxonUuid, false, false, null, null, null, null, null, null, null); |
|
73 |
} catch (Exception e) { |
|
74 |
e.printStackTrace(); |
|
75 |
} |
|
81 | 76 |
} |
82 | 77 |
|
83 | 78 |
protected <T> T getTargetObject(Object proxy) throws Exception { |
app-import/src/main/java/eu/etaxonomy/cdm/io/caryo/CaryoTransformer.java | ||
---|---|---|
1 | 1 |
/** |
2 | 2 |
* Copyright (C) 2007 EDIT |
3 |
* European Distributed Institute of Taxonomy
|
|
3 |
* European Distributed Institute of Taxonomy |
|
4 | 4 |
* http://www.e-taxonomy.eu |
5 |
*
|
|
5 |
* |
|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
... | ... | |
21 | 21 |
/** |
22 | 22 |
* @author a.mueller |
23 | 23 |
* @created 01.03.2010 |
24 |
* @version 1.0 |
|
25 | 24 |
*/ |
26 | 25 |
public final class CaryoTransformer extends InputTransformerBase { |
27 |
@SuppressWarnings("unused") |
|
26 |
|
|
27 |
private static final long serialVersionUID = 4211928286547705792L; |
|
28 |
@SuppressWarnings("unused") |
|
28 | 29 |
private static final Logger logger = Logger.getLogger(CaryoTransformer.class); |
29 |
|
|
30 |
|
|
30 | 31 |
|
31 | 32 |
//feature |
32 | 33 |
// public static final UUID endemismUuid = UUID.fromString("dd343c31-1916-4786-a530-536ea995dce4"); |
33 |
|
|
34 | 34 |
|
35 |
|
|
36 |
/* (non-Javadoc) |
|
37 |
* @see eu.etaxonomy.cdm.io.common.mapping.InputTransformerBase#getMarkerTypeByKey(java.lang.String) |
|
38 |
*/ |
|
39 | 35 |
@Override |
40 | 36 |
public MarkerType getMarkerTypeByKey(String key) throws UndefinedTransformerMethodException { |
41 | 37 |
if (StringUtils.isBlank(key)){return null; |
... | ... | |
53 | 49 |
}else{ |
54 | 50 |
return null; |
55 | 51 |
} |
56 |
|
|
57 | 52 |
} |
58 |
|
|
59 | 53 |
|
60 |
|
|
54 |
|
|
55 |
|
|
61 | 56 |
@Override |
62 | 57 |
public UUID getFeatureUuid(String key) throws UndefinedTransformerMethodException { |
63 | 58 |
if (StringUtils.isBlank(key)){return null; |
... | ... | |
69 | 64 |
} |
70 | 65 |
|
71 | 66 |
|
72 |
|
|
73 |
|
|
74 |
|
|
75 |
|
|
76 |
|
|
77 |
|
|
78 |
|
|
79 | 67 |
} |
Also available in: Unified diff
cleanup