import eu.etaxonomy.cdm.io.common.Source;\r
import eu.etaxonomy.cdm.io.common.mapping.DbImportMapping;\r
import eu.etaxonomy.cdm.io.common.mapping.UndefinedTransformerMethodException;\r
-import eu.etaxonomy.cdm.model.agent.INomenclaturalAuthor;\r
import eu.etaxonomy.cdm.model.agent.Person;\r
import eu.etaxonomy.cdm.model.agent.Team;\r
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;\r
zooName.setExBasionymAuthorship(getExistingAuthor(zooName.getExBasionymAuthorship(), state));\r
}\r
\r
- private TeamOrPersonBase<?> getExistingAuthor(INomenclaturalAuthor nomAuthor, GlobisImportState state) {\r
- TeamOrPersonBase<?> author = (TeamOrPersonBase<?>)nomAuthor;\r
+ private TeamOrPersonBase<?> getExistingAuthor(TeamOrPersonBase<?> nomAuthor, GlobisImportState state) {\r
+ TeamOrPersonBase<?> author = nomAuthor;\r
if (author == null){\r
return null;\r
}\r
*/
package eu.etaxonomy.cdm.io.mexico;
-import eu.etaxonomy.cdm.common.URI;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
+import eu.etaxonomy.cdm.common.URI;
import eu.etaxonomy.cdm.model.common.Language;
import eu.etaxonomy.cdm.model.description.CommonTaxonName;
import eu.etaxonomy.cdm.model.description.TaxonDescription;
/**
* @author a.mueller
* @since 16.06.2016
- *
*/
@Component
public class MexicoConabioCommonNamesImport<CONFIG extends MexicoConabioImportConfigurator>
private Map<String, Taxon> taxonIdMap;
-
@Override
protected String getWorksheetName(CONFIG config) {
return "NombresComunes";
null, null, ref, null);
}
-
getTaxonService().save(taxon);
}
}
}
}
- /**
- * @param state
- */
+
@SuppressWarnings("unchecked")
private void initLanguageVocabulary(SimpleExcelTaxonImportState<CONFIG> state) {
if (languagesVoc == null){
return ref;
}
- /**
- * @param taxon
- * @return
- */
private TaxonDescription getTaxonDescription(Taxon taxon) {
if (!taxon.getDescriptions().isEmpty()){
return taxon.getDescriptions().iterator().next();
*/
package eu.etaxonomy.cdm.io.mexico;
-import eu.etaxonomy.cdm.common.URI;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
+import eu.etaxonomy.cdm.common.URI;
import eu.etaxonomy.cdm.ext.geo.GeoServiceArea;
import eu.etaxonomy.cdm.ext.geo.GeoServiceAreaAnnotatedMapping;
import eu.etaxonomy.cdm.io.common.mapping.UndefinedTransformerMethodException;
/**
* @author a.mueller
* @since 16.06.2016
- *
*/
@Component
public class MexicoConabioDistributionImport<CONFIG extends MexicoConabioImportConfigurator>
return mexico;
}
- /**
- * @param state
- * @param refStr
- * @return
- */
private Reference getReference(SimpleExcelTaxonImportState<CONFIG> state, String refStr) {
if (StringUtils.isBlank(refStr)){
return null;
return ref;
}
- /**
- * @param desc
- * @param string
- * @param uuidUserDefinedAnnotationTypeVocabulary
- */
private void handleDistribution(SimpleExcelTaxonImportState<CONFIG> state, TaxonDescription desc, String key,
UUID uuid, String line) {
Map<String, String> record = state.getOriginalRecord();
}
}
- /**
- * @param taxon
- * @return
- */
private TaxonDescription getTaxonDescription(Taxon taxon) {
if (!taxon.getDescriptions().isEmpty()){
return taxon.getDescriptions().iterator().next();
}
}
- /**
- * @param state
- */
@SuppressWarnings("unchecked")
private void initAreaVocabulary(SimpleExcelTaxonImportState<CONFIG> state) {
if (stateAreasVoc == null){
}
}
- /**
- * @param state
- * @return
- */
@SuppressWarnings("unchecked")
private void createStateAreasVoc(SimpleExcelTaxonImportState<CONFIG> state) {
//voc
package eu.etaxonomy.cdm.io.mexico;
import eu.etaxonomy.cdm.common.URI;
-
import eu.etaxonomy.cdm.database.ICdmDataSource;
import eu.etaxonomy.cdm.io.common.ImportStateBase;
import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer;
public void setSecReference(Reference secReference) {
this.secReference = secReference;
}
-
-}
+}
\ No newline at end of file
/**
* @author a.mueller
* @since 16.06.2016
- *
*/
@Component
public class MexicoConabioTaxonImport<CONFIG extends MexicoConabioImportConfigurator>
}
}
- /**
- * @param state
- * @param secRefStr
- * @return
- */
private Reference getSecRef(SimpleExcelTaxonImportState<CONFIG> state, String secRefStr, String line) {
Reference result = state.getReference(secRefStr);
if (result == null && secRefStr != null){
return result;
}
-
-
- /**
- * @param team
- * @param author
- */
private void addTeamMember(Team team, String author) {
if (StringUtils.isNotBlank(author)){
Person person = Person.NewInstance();
}
}
-
-
- /**
- * @param record
- * @param state
- * @return
- */
private IBotanicalName makeName(String line, Map<String, String> record, SimpleExcelTaxonImportState<CONFIG> state) {
String authorStr = getValueNd(record, "AutorSinAnio");
return result;
}
-
-
- /**
- * @param name
- * @param state
- */
private void addSourcesToReferences(IBotanicalName name, SimpleExcelTaxonImportState<CONFIG> state) {
Reference nomRef = name.getNomenclaturalReference();
if (nomRef != null){
}
}
-
-
- /**
- * @param referencedName
- * @param refType
- */
private void adaptRefTypeForGeneric(IBotanicalName referencedName, String refTypeStr) {
INomenclaturalReference ref = referencedName.getNomenclaturalReference();
if (ref == null){
}
}
-
private ReferenceType refTypeByRefTypeStr(String refType){
if ("A".equals(refType)){ //Article
return ReferenceType.Article;
}
}
- /**
- * @param nomRefStr
- * @param refType
- * @param fullNameStr
- * @return
- */
private String getRefNameStr(String nomRefStr, String refTypeStr, String fullNameStr) {
String refNameStr = fullNameStr;
ReferenceType refType = refTypeByRefTypeStr(refTypeStr);
return refNameStr;
}
- /**
- * @param state
- * @param equal
- * @param referencedName
- */
private void addNomRefExtension(SimpleExcelTaxonImportState<CONFIG> state, IBotanicalName name, Boolean equal) {
String equalStr = equal == null ? "" : equal == true ? "EQUAL\n" : "NOT EQUAL\n";
name.setFullTitleCache(null, false);
}
boolean nameMapIsInitialized = false;
- /**
- * @param state
- * @param fullName
- * @return
- */
private IBotanicalName getExistingName(SimpleExcelTaxonImportState<CONFIG> state, IBotanicalName fullName) {
initExistinNames(state);
return (IBotanicalName)state.getName(fullName.getTitleCache());
}
- /**
- * @param state
- */
- @SuppressWarnings("rawtypes")
private void initExistinNames(SimpleExcelTaxonImportState<CONFIG> state) {
if (!nameMapIsInitialized){
List<String> propertyPaths = Arrays.asList("");
}
}
-
-
/**
- * @param record
- * @param string
- * @return
+ * Same as {@link #getValue(eu.etaxonomy.cdm.io.excel.common.ExcelImportState, String)}
+ * but "ND" return null.
*/
private String getValueNd(Map<String, String> record, String string) {
String value = getValue(record, string);
}
}
-
@Override
protected void secondPass(SimpleExcelTaxonImportState<CONFIG> state) {
// IdCAT_AscendenteInmediato, IdCATRel, TipoRelacion
}
}
- /**
- * @param line
- * @param name
- */
private void makeConceptRelation(String line, TaxonName name) {
if (name.getTaxonBases().size()==2){
Iterator<TaxonBase> it = name.getTaxonBases().iterator();
}else if (name.getTaxonBases().size()>2){
logger.warn(line + "Names with more than 2 taxa not yet handled");
}
-
}
- /**
- * @param next
- * @return
- */
private Taxon getAccepted(TaxonBase<?> taxonBase) {
if (taxonBase.isInstanceOf(Taxon.class)){
return CdmBase.deproxy(taxonBase, Taxon.class);
return classification;
}
-
@Override
protected boolean isIgnore(SimpleExcelTaxonImportState<CONFIG> state) {
return ! state.getConfig().isDoTaxa();
}
-}
+}
\ No newline at end of file
/**
* @author a.mueller
* @since 16.06.2016
- *
*/
public class MexicoConabioTransformer extends InputTransformerBase{
public static final UUID uuidYucatan = UUID.fromString("5dd5d5fa-77f0-42f6-a45c-384130e5f16d");
public static final UUID uuidZacatecas = UUID.fromString("0e9bc1f2-0154-4424-85c7-1bfc8cf3696c");
-
public static final UUID uuidMexicanLanguagesVoc = UUID.fromString("d37d043e-94af-4cb0-b702-e6f45318b039");
public static final UUID uuidChontal = UUID.fromString("e2ea70d0-605b-4e21-9848-aefe38ea6abb");
}
}
-
@Override
public UUID getPresenceTermUuid(String key) throws UndefinedTransformerMethodException {
if (StringUtils.isBlank(key)){
return null;
}
}
-
-
-
-}
+}
\ No newline at end of file
return IdentifiableSource.NewDataImportInstance("line: " + state.getCurrentLine(), null, state.getConfig().getSourceReference());
}
- /**
- * @param state
- * @param speciesName
- * @param sec
- * @param taxon
- * @param familyNode
- */
protected void makeGenus(SimpleExcelTaxonImportState<CONFIG> state,
IBotanicalName speciesName,
Reference sec,
/**
* @author a.mueller
* @since 16.06.2016
- *
*/
public class SimpleExcelTaxonImportState<CONFIG extends ExcelImportConfiguratorBase>
extends ExcelImportState<CONFIG, ExcelRowBase>{
private final Map<String, Taxon> taxonMap = new HashMap<>();
// ************************* CONSTRUCTUR *******************************/
- /**
- * @param config
- */
+
public SimpleExcelTaxonImportState(CONFIG config) {
super(config);
}
public boolean containsTaxon(String key) {
return taxonMap.containsKey(key);
}
-
-}
+}
\ No newline at end of file
import eu.etaxonomy.cdm.io.common.mapping.IMappingImport;\r
import eu.etaxonomy.cdm.io.common.mapping.UndefinedTransformerMethodException;\r
import eu.etaxonomy.cdm.io.eflora.centralAfrica.ferns.validation.CentralAfricaFernsTaxonImportValidator;\r
-import eu.etaxonomy.cdm.model.agent.INomenclaturalAuthor;\r
+import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;\r
import eu.etaxonomy.cdm.model.common.CdmBase;\r
import eu.etaxonomy.cdm.model.common.Language;\r
import eu.etaxonomy.cdm.model.description.CommonTaxonName;\r
* @param author\r
* @return\r
*/\r
- private String getNomTitleNz(INomenclaturalAuthor author) {\r
+ private String getNomTitleNz(TeamOrPersonBase<?> author) {\r
if (author != null){\r
return CdmUtils.Nz(author.getNomenclaturalTitleCache());\r
}else{\r