Project

General

Profile

« Previous | Next » 

Revision 4e54c1d9

Added by Andreas Müller over 7 years ago

Add some Spanish representations to Salvador terms

View differences:

app-import/src/main/java/eu/etaxonomy/cdm/io/berlinModel/in/BerlinModelFactsImport.java
51 51
import eu.etaxonomy.cdm.model.common.MarkerType;
52 52
import eu.etaxonomy.cdm.model.common.OriginalSourceType;
53 53
import eu.etaxonomy.cdm.model.common.Representation;
54
import eu.etaxonomy.cdm.model.common.TermBase;
54 55
import eu.etaxonomy.cdm.model.common.TermType;
55 56
import eu.etaxonomy.cdm.model.common.TermVocabulary;
56 57
import eu.etaxonomy.cdm.model.description.CommonTaxonName;
......
203 204
     */
204 205
    private void adaptNewSalvadorFeature(int factCategoryId, Feature feature) {
205 206
        if (factCategoryId == 306){
206
            addSpanishFactCategoryName(feature, "Nombre(s) común(es)");
207
            addSpanishRepresentationLabel(feature, "Nombre(s) común(es)");
207 208
        } else if (factCategoryId == 307){
208
            addSpanishFactCategoryName(feature, "Muestras de herbario");
209
            addSpanishRepresentationLabel(feature, "Muestras de herbario");
209 210
        } else if (factCategoryId == 310){
210 211
            addEnglishFactCategoryName(feature, "Other references for taxon");
211 212
        } else if (factCategoryId == 309){
......
213 214
        } else if (factCategoryId == 311){
214 215
            addEnglishFactCategoryName(feature, "Taxon illustration references");
215 216
        } else if (factCategoryId == 312){
216
            addSpanishFactCategoryName(feature, "Imágen");
217
            addSpanishRepresentationLabel(feature, "Imágen");
217 218
        } else if (factCategoryId == 350){
218
            addSpanishFactCategoryName(feature, "Descripción");
219
            addSpanishRepresentationLabel(feature, "Descripción");
219 220
        } else if (factCategoryId == 303){
220 221
            addEnglishFactCategoryName(feature, "General distribution");
221 222
        } else if (factCategoryId == 2000){
222 223
            addEnglishFactCategoryName(feature, "Habitat in El Salvador");
223 224
        } else if (factCategoryId == 302){
224
            addSpanishFactCategoryName(feature, "Usos");
225
            addSpanishRepresentationLabel(feature, "Usos");
225 226
        } else if (factCategoryId == 1800){
226 227
            addEnglishFactCategoryName(feature, "Specimen notes");
227 228
        } else if (factCategoryId == 1900){
......
235 236
     * @param feature
236 237
     * @param string
237 238
     */
238
    private void addSpanishFactCategoryName(Feature feature, String label) {
239
        feature.getRepresentations().add(Representation.NewInstance(label, label, null, Language.SPANISH_CASTILIAN()));
239
    private void addSpanishRepresentationLabel(TermBase term, String label) {
240
        term.getRepresentations().add(Representation.NewInstance(label, label, null, Language.SPANISH_CASTILIAN()));
240 241
    }
241 242

  
242 243
    /**
......
251 252

  
252 253
    @Override
253 254
	protected void doInvoke(BerlinModelImportState state) {
255
        if (state.getConfig().isSalvador()){
256
            invokeSpanishTermLabels();
257
        }
254 258
		featureMap = invokeFactCategories(state);
255 259
		super.doInvoke(state);
256 260
		return;
257 261
	}
258 262

  
259 263

  
260
	@Override
264
	/**
265
     *
266
     */
267
    private void invokeSpanishTermLabels() {
268
        addSpanishRepresentationLabel(Feature.NOTES(), "Notas");
269
        addSpanishRepresentationLabel(NamedAreaLevel.DEPARTMENT(), "Departamento");
270
        addSpanishRepresentationLabel(PresenceAbsenceTerm.NATIVE(), "nativo");
271
        addSpanishRepresentationLabel(PresenceAbsenceTerm.CULTIVATED(), "cultivado");
272
        addSpanishRepresentationLabel(PresenceAbsenceTerm.PRESENT(), "presente");
273

  
274

  
275
    }
276

  
277

  
278
    @Override
261 279
	protected String getIdQuery(BerlinModelImportState state) {
262 280
		String result = super.getIdQuery(state);
263 281
		if (StringUtils.isNotBlank(state.getConfig().getFactFilter())){

Also available in: Unified diff