Revision 7ad9934d
Added by Andreas Müller almost 13 years ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/markup/MarkupImportBase.java | ||
---|---|---|
33 | 33 |
import eu.etaxonomy.cdm.io.common.events.IoProblemEvent; |
34 | 34 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
35 | 35 |
import eu.etaxonomy.cdm.model.common.DefinedTermBase; |
36 |
import eu.etaxonomy.cdm.model.description.PolytomousKey; |
|
36 | 37 |
import eu.etaxonomy.cdm.model.taxon.Classification; |
37 | 38 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
38 | 39 |
|
... | ... | |
64 | 65 |
}else if (cdmBase.isInstanceOf(Classification.class)){ |
65 | 66 |
Classification classification = CdmBase.deproxy(cdmBase, Classification.class); |
66 | 67 |
getClassificationService().saveOrUpdate(classification); |
68 |
}else if (cdmBase.isInstanceOf(PolytomousKey.class)){ |
|
69 |
PolytomousKey key = CdmBase.deproxy(cdmBase, PolytomousKey.class); |
|
70 |
getPolytomousKeyService().saveOrUpdate(key); |
|
67 | 71 |
}else if (cdmBase.isInstanceOf(DefinedTermBase.class)){ |
68 | 72 |
DefinedTermBase term = CdmBase.deproxy(cdmBase, DefinedTermBase.class); |
69 | 73 |
getTermService().saveOrUpdate(term); |
... | ... | |
539 | 543 |
* @return |
540 | 544 |
*/ |
541 | 545 |
protected String getClassOnlyAttribute(XMLEvent parentEvent, boolean required) { |
546 |
return getOnlyAttribute(parentEvent, CLASS, required); |
|
547 |
} |
|
548 |
|
|
549 |
/** |
|
550 |
* Returns the value for the only attribute for a given event and checks that it is the only attribute. |
|
551 |
* @param parentEvent |
|
552 |
* @return |
|
553 |
*/ |
|
554 |
protected String getOnlyAttribute(XMLEvent parentEvent, String attrName, boolean required) { |
|
542 | 555 |
Map<String, Attribute> attributes = getAttributes(parentEvent); |
543 |
String classValue =getAndRemoveAttributeValue(parentEvent, attributes, CLASS, required, 1);
|
|
556 |
String classValue =getAndRemoveAttributeValue(parentEvent, attributes, attrName, required, 1);
|
|
544 | 557 |
checkNoAttributes(attributes, parentEvent); |
545 | 558 |
return classValue; |
546 | 559 |
} |
Also available in: Unified diff
update to markup import