Revision 44fc1b63
Added by Andreas Müller over 6 years ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/dwca/in/CsvStream.java | ||
---|---|---|
119 | 119 |
break; |
120 | 120 |
} |
121 | 121 |
} |
122 |
String value = next[index]; |
|
122 |
String value = field.getDefault()!= null? field.getDefault(): next[index];
|
|
123 | 123 |
String term = field.getTerm(); |
124 | 124 |
resultMap.put(term, value); |
125 | 125 |
} |
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/dwca/in/DwcaImportTransformer.java | ||
---|---|---|
45 | 45 |
}else if (key.equalsIgnoreCase("associations")){ |
46 | 46 |
return Feature.INDIVIDUALS_ASSOCIATION(); //correct ? |
47 | 47 |
}else if (key.equalsIgnoreCase("distribution")){ |
48 |
return Feature.DISTRIBUTION(); |
|
48 |
return Feature.DISTRIBUTION_GENERAL();
|
|
49 | 49 |
}else if (key.equalsIgnoreCase("habitat")){ |
50 | 50 |
return Feature.HABITAT(); |
51 | 51 |
}else if (key.equalsIgnoreCase("uses")){ |
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/dwca/jaxb/Field.java | ||
---|---|---|
12 | 12 |
import javax.xml.bind.annotation.XmlAccessorType; |
13 | 13 |
import javax.xml.bind.annotation.XmlAttribute; |
14 | 14 |
import javax.xml.bind.annotation.XmlRootElement; |
15 |
import javax.xml.bind.annotation.XmlTransient; |
|
15 | 16 |
import javax.xml.bind.annotation.XmlType; |
16 | 17 |
|
17 | 18 |
|
... | ... | |
63 | 64 |
@XmlAttribute(required = true) |
64 | 65 |
protected String term; |
65 | 66 |
@XmlAttribute(required = true) |
66 |
protected byte index; |
|
67 |
protected byte index = -1; |
|
68 |
@XmlTransient |
|
69 |
protected String defaultValue; |
|
70 |
|
|
67 | 71 |
|
68 | 72 |
public String getTerm() { |
69 | 73 |
return term; |
... | ... | |
79 | 83 |
public void setIndex(byte value) { |
80 | 84 |
this.index = value; |
81 | 85 |
} |
82 |
|
|
86 |
|
|
87 |
@XmlAttribute(required = false) |
|
88 |
public String getDefault() { |
|
89 |
return defaultValue; |
|
90 |
} |
|
91 |
public void setDefault(String defaultValue) { |
|
92 |
this.defaultValue = defaultValue; |
|
93 |
} |
|
94 |
|
|
83 | 95 |
@Override |
84 | 96 |
public String toString(){ |
85 |
return "[" + index + ";" + term + "]"; |
|
97 |
return "[" + index + ";" + term + (defaultValue != null? ";" + defaultValue:"") + "]";
|
|
86 | 98 |
} |
87 | 99 |
|
88 | 100 |
} |
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/Feature.java | ||
---|---|---|
156 | 156 |
private static final UUID uuidUnknown = UUID.fromString("910307f1-dc3c-452c-a6dd-af5ac7cd365c"); |
157 | 157 |
public static final UUID uuidDescription = UUID.fromString("9087cdcd-8b08-4082-a1de-34c9ba9fb493"); |
158 | 158 |
private static final UUID uuidDistribution = UUID.fromString("9fc9d10c-ba50-49ee-b174-ce83fc3f80c6"); |
159 |
private static final UUID uuidDistributionGeneral = UUID.fromString("fd8c64f0-6ea5-44b0-9f70-e95833d6076e"); |
|
159 | 160 |
private static final UUID uuidEcology = UUID.fromString("aa923827-d333-4cf5-9a5f-438ae0a4746b"); |
160 | 161 |
private static final UUID uuidHabitat = UUID.fromString("fb16929f-bc9c-456f-9d40-dec987b36438"); |
161 | 162 |
private static final UUID uuidHabitatAndEcology = UUID.fromString("9fdc4663-4d56-47d0-90b5-c0bf251bafbb"); |
... | ... | |
708 | 709 |
return getTermByUuid(uuidDistribution); |
709 | 710 |
} |
710 | 711 |
|
712 |
/** |
|
713 |
* Returns the feature for general text-based |
|
714 |
* distributions |
|
715 |
*/ |
|
716 |
public static final Feature DISTRIBUTION_GENERAL(){ |
|
717 |
return getTermByUuid(uuidDistributionGeneral); |
|
718 |
} |
|
719 |
|
|
711 | 720 |
/** |
712 | 721 |
* Returns the "discussion" feature. This feature can only be described |
713 | 722 |
* with {@link TextData text data}. |
Also available in: Unified diff
ref #6887 add description.txt to CoL import