|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.etaxonomy.cdm.api.application.CdmApplicationDefaultConfiguration
eu.etaxonomy.cdm.io.common.CdmIoBase<STATE>
eu.etaxonomy.cdm.io.common.CdmImportBase<CONFIG,STATE>
public abstract class CdmImportBase<CONFIG extends IImportConfigurator,STATE extends ImportStateBase>
| Nested Class Summary | |
|---|---|
static class |
CdmImportBase.TermMatchMode
|
| Field Summary | |
|---|---|
protected static boolean |
CREATE
|
protected static boolean |
IMAGE_GALLERY
|
protected static boolean |
READ_MEDIA_DATA
|
static UUID |
uuidUserDefinedAnnotationTypeVocabulary
|
static UUID |
uuidUserDefinedExtensionTypeVocabulary
|
static UUID |
uuidUserDefinedFeatureVocabulary
|
static UUID |
uuidUserDefinedMarkerTypeVocabulary
|
static UUID |
uuidUserDefinedMeasurementUnitVocabulary
|
static UUID |
uuidUserDefinedModifierVocabulary
|
static UUID |
uuidUserDefinedNamedAreaLevelVocabulary
|
static UUID |
uuidUserDefinedNamedAreaVocabulary
|
static UUID |
uuidUserDefinedRankVocabulary
|
static UUID |
uuidUserDefinedReferenceSystemVocabulary
|
static UUID |
uuidUserDefinedStateVocabulary
|
static UUID |
uuidUserDefinedStatisticalMeasureVocabulary
|
static UUID |
uuidUserDefinedTaxonRelationshipTypeVocabulary
|
| Fields inherited from class eu.etaxonomy.cdm.io.common.CdmIoBase |
|---|
ioName |
| Fields inherited from class eu.etaxonomy.cdm.api.application.CdmApplicationDefaultConfiguration |
|---|
applicationContext |
| Fields inherited from interface eu.etaxonomy.cdm.io.common.ICdmIO |
|---|
FEATURE_STORE, NOMREF_DETAIL_STORE, NOMREF_STORE, PERSON_STORE, REF_DETAIL_STORE, REFERENCE_STORE, SPECIMEN_STORE, TAXON_STORE, TAXONNAME_STORE, TEAM_STORE, USER_STORE |
| Constructor Summary | |
|---|---|
CdmImportBase()
|
|
| Method Summary | ||
|---|---|---|
void |
addOriginalSource(CdmBase cdmBase,
Object idAttributeValue,
String namespace,
Reference citation)
Adds an orginal source to a sourceable objects (implemented for Identifiable entity and description element. |
|
void |
addOriginalSource(ResultSet rs,
CdmBase cdmBase,
String dbIdAttribute,
String namespace,
Reference citation)
|
|
protected void |
fillMissingEpithets(NonViralName parentName,
NonViralName childName)
If the child name is missing genus or species epithet information and the rank is below genus or species respectively the according epithets are taken from the parent name. |
|
protected void |
fillMissingEpithetsForTaxa(Taxon parentTaxon,
Taxon childTaxon)
If the child taxon is missing genus or species epithet information and the rank is below genus or species respectively the according epithets are taken from the parent taxon. |
|
protected Taxon |
getAcceptedTaxon(TaxonBase<?> taxonBase)
Returns the accepted taxon of a taxon base. |
|
protected AnnotationType |
getAnnotationType(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev,
TermVocabulary<AnnotationType> voc)
|
|
protected ExtensionType |
getExtensionType(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev)
|
|
protected ExtensionType |
getExtensionType(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev,
TermVocabulary<ExtensionType> voc)
|
|
protected Feature |
getFeature(STATE state,
UUID uuid)
Returns a feature if it exists, null otherwise. |
|
protected Feature |
getFeature(STATE state,
UUID uuid,
String label,
String description,
String labelAbbrev,
TermVocabulary<Feature> voc)
Returns a feature for a given uuid by first checking if the uuid has already been used in this import, if not checking if the feature exists in the database, if not creating it anew (with vocabulary etc.). |
|
protected TextData |
getFeaturePlaceholder(STATE state,
DescriptionBase<?> description,
Feature feature,
boolean createIfNotExists)
Returns the textdata that holds general information about a feature for a taxon description. |
|
protected Media |
getImageMedia(String uriString,
boolean readMediaData,
boolean isFigure)
Creates |
|
protected Language |
getLanguage(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev)
Returns a language for a given uuid by first ... |
|
protected Language |
getLanguage(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev,
TermVocabulary voc)
|
|
protected MarkerType |
getMarkerType(STATE state,
String keyString)
|
|
protected MarkerType |
getMarkerType(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev)
|
|
protected MarkerType |
getMarkerType(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev,
TermVocabulary<MarkerType> voc)
|
|
protected MeasurementUnit |
getMeasurementUnit(STATE state,
UUID uuid,
String label,
String description,
String labelAbbrev,
TermVocabulary<MeasurementUnit> voc)
Returns a MeasurementUnit for a given uuid by first checking if the uuid has already been used in this import, if not
checking if the MeasurementUnit exists in the database, if not creating it anew (with vocabulary etc.). |
|
protected Modifier |
getModifier(STATE state,
UUID uuid,
String label,
String description,
String labelAbbrev,
TermVocabulary<Modifier> voc)
Returns a Modifier for a given uuid by first checking if the uuid has already been used in this import, if not
checking if the Modifier exists in the database, if not creating it anew (with vocabulary etc.). |
|
protected NamedArea |
getNamedArea(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev,
NamedAreaType areaType,
NamedAreaLevel level)
Returns a named area for a given uuid by first . |
|
protected NamedArea |
getNamedArea(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev,
NamedAreaType areaType,
NamedAreaLevel level,
TermVocabulary voc,
CdmImportBase.TermMatchMode matchMode)
|
|
protected NamedAreaLevel |
getNamedAreaLevel(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev,
TermVocabulary<NamedAreaLevel> voc)
|
|
protected PresenceTerm |
getPresenceTerm(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev)
Returns a presence term for a given uuid by first ... |
|
protected Rank |
getRank(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev,
OrderedTermVocabulary<Rank> voc,
Rank lowerRank)
|
|
protected ReferenceSystem |
getReferenceSystem(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev,
TermVocabulary voc)
|
|
SpecimenDescription |
getSpecimenDescription(SpecimenOrObservationBase specimen,
boolean isImageGallery,
boolean createNewIfNotExists)
Returns the specimen description for a specimen or observation. |
|
SpecimenDescription |
getSpecimenDescription(SpecimenOrObservationBase specimen,
Reference ref,
boolean isImageGallery,
boolean createNewIfNotExists)
Like getSpecimenDescription(SpecimenOrObservationBase, boolean, boolean)
Only matches a description if the given reference is a source of the description.If a new description is created the given reference will be added as a source. |
|
protected State |
getStateTerm(STATE state,
UUID uuid)
Returns a State if it exists. |
|
protected State |
getStateTerm(STATE importState,
UUID uuid,
String label,
String text,
String labelAbbrev,
OrderedTermVocabulary<State> voc)
Returns a State for a given uuid by first checking if the uuid has already been used in this import, if not
checking if the state exists in the database, if not creating it anew (with vocabulary etc.). |
|
protected StatisticalMeasure |
getStatisticalMeasure(STATE state,
UUID uuid,
String label,
String description,
String labelAbbrev,
TermVocabulary<StatisticalMeasure> voc)
Returns a StatisticalMeasure for a given uuid by first checking if the uuid has already been used in this import, if not
checking if the StatisticalMeasure exists in the database, if not creating it anew (with vocabulary etc.). |
|
TaxonDescription |
getTaxonDescription(Taxon taxon,
boolean isImageGallery,
boolean createNewIfNotExists)
Returns the taxon description for a taxon. |
|
TaxonDescription |
getTaxonDescription(Taxon taxon,
Reference ref,
boolean isImageGallery,
boolean createNewIfNotExists)
Like getTaxonDescription(Taxon, boolean, boolean)
Only matches a description if the given reference is a source of the description.If a new description is created the given reference will be added as a source. |
|
TaxonNameDescription |
getTaxonNameDescription(TaxonNameBase<?,?> name,
Reference ref,
boolean isImageGallery,
boolean createNewIfNotExists)
Like getTaxonDescription(Taxon, boolean, boolean)
Only matches a description if the given reference is a source of the description.If a new description is created the given reference will be added as a source. |
|
TaxonNameDescription |
getTaxonNameDescription(TaxonNameBase name,
boolean isImageGallery,
boolean createNewIfNotExists)
Returns the taxon description for a taxon. |
|
protected TaxonRelationshipType |
getTaxonRelationshipType(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev,
TermVocabulary<TaxonRelationshipType> voc)
Returns a taxon relationship type for a given uuid by first checking if the uuid has already been used in this import, if not checking if the taxon relationship type exists in the database, if not creating it anew (with vocabulary etc.). |
|
protected
|
getVocabulary(UUID uuid,
String text,
String label,
String abbrev,
URI termSourceUri,
boolean isOrdered,
T type)
|
|
protected Classification |
makeTree(STATE state,
Reference reference)
|
|
protected Classification |
makeTreeMemSave(STATE state,
Reference ref)
Alternative memory saving method variant of #makeTree(STATE state, Reference ref) which stores only the
UUID instead of the full tree in the ImportStateBase by
using state.putTreeUuid(ref, tree); |
|
protected String |
NB(String str)
Returns null for all blank strings. |
|
protected Double |
nullSafeDouble(ResultSet rs,
String columnName)
|
|
protected Float |
nullSafeFloat(ResultSet rs,
String columnName)
|
|
protected Integer |
nullSafeInt(ResultSet rs,
String columnName)
Retrieves an Integer value from a result set. |
|
| Methods inherited from class eu.etaxonomy.cdm.io.common.CdmIoBase |
|---|
addObserver, addObservers, check, commitTransaction, countObservers, countSteps, doCheck, doInvoke, fire, fireProgressEvent, fireWarningEvent, fireWarningEvent, flush, getInstance, getObservers, getSuccessString, invoke, isBlank, isIgnore, isNotBlank, removeObserver, removeObservers, rollbackTransaction, startTransaction, startTransaction, updateProgress, updateProgress, warnProgress |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface eu.etaxonomy.cdm.io.common.ICdmIO |
|---|
check, fire, invoke, updateProgress, updateProgress, warnProgress |
| Methods inherited from interface eu.etaxonomy.cdm.io.common.IIoObservable |
|---|
addObserver, addObservers, countObservers, getObservers, removeObserver, removeObservers |
| Field Detail |
|---|
protected static final boolean CREATE
protected static final boolean IMAGE_GALLERY
protected static final boolean READ_MEDIA_DATA
public static final UUID uuidUserDefinedNamedAreaLevelVocabulary
public static final UUID uuidUserDefinedNamedAreaVocabulary
public static final UUID uuidUserDefinedExtensionTypeVocabulary
public static final UUID uuidUserDefinedReferenceSystemVocabulary
public static final UUID uuidUserDefinedFeatureVocabulary
public static final UUID uuidUserDefinedMeasurementUnitVocabulary
public static final UUID uuidUserDefinedStatisticalMeasureVocabulary
public static final UUID uuidUserDefinedStateVocabulary
public static final UUID uuidUserDefinedTaxonRelationshipTypeVocabulary
public static final UUID uuidUserDefinedAnnotationTypeVocabulary
public static final UUID uuidUserDefinedMarkerTypeVocabulary
public static final UUID uuidUserDefinedRankVocabulary
public static final UUID uuidUserDefinedModifierVocabulary
| Constructor Detail |
|---|
public CdmImportBase()
| Method Detail |
|---|
protected Classification makeTree(STATE state,
Reference reference)
protected Classification makeTreeMemSave(STATE state,
Reference ref)
#makeTree(STATE state, Reference ref) which stores only the
UUID instead of the full tree in the ImportStateBase by
using state.putTreeUuid(ref, tree);
state - ref -
protected ExtensionType getExtensionType(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev)
protected ExtensionType getExtensionType(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev,
TermVocabulary<ExtensionType> voc)
protected MarkerType getMarkerType(STATE state,
String keyString)
protected MarkerType getMarkerType(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev)
protected MarkerType getMarkerType(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev,
TermVocabulary<MarkerType> voc)
protected AnnotationType getAnnotationType(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev,
TermVocabulary<AnnotationType> voc)
protected ReferenceSystem getReferenceSystem(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev,
TermVocabulary voc)
protected Rank getRank(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev,
OrderedTermVocabulary<Rank> voc,
Rank lowerRank)
protected NamedArea getNamedArea(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev,
NamedAreaType areaType,
NamedAreaLevel level)
state - uuid - label - text - labelAbbrev - areaType - level -
protected NamedArea getNamedArea(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev,
NamedAreaType areaType,
NamedAreaLevel level,
TermVocabulary voc,
CdmImportBase.TermMatchMode matchMode)
protected NamedAreaLevel getNamedAreaLevel(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev,
TermVocabulary<NamedAreaLevel> voc)
protected State getStateTerm(STATE state,
UUID uuid)
State if it exists. null otherwise.
state - uuid -
State
protected State getStateTerm(STATE importState,
UUID uuid,
String label,
String text,
String labelAbbrev,
OrderedTermVocabulary<State> voc)
State for a given uuid by first checking if the uuid has already been used in this import, if not
checking if the state exists in the database, if not creating it anew (with vocabulary etc.).
If label, text and labelAbbrev are all null no state is created.
importState - uuid - label - text - labelAbbrev - voc -
protected Feature getFeature(STATE state,
UUID uuid)
state - uuid -
getFeature(ImportStateBase, UUID, String, String, String, TermVocabulary)
protected Feature getFeature(STATE state,
UUID uuid,
String label,
String description,
String labelAbbrev,
TermVocabulary<Feature> voc)
null no feature is created.
state - uuid - label - text - labelAbbrev -
protected MeasurementUnit getMeasurementUnit(STATE state,
UUID uuid,
String label,
String description,
String labelAbbrev,
TermVocabulary<MeasurementUnit> voc)
MeasurementUnit for a given uuid by first checking if the uuid has already been used in this import, if not
checking if the MeasurementUnit exists in the database, if not creating it anew (with vocabulary etc.).
If label, text and labelAbbrev are all null no MeasurementUnit is created.
state - uuid - label - text - labelAbbrev -
protected StatisticalMeasure getStatisticalMeasure(STATE state,
UUID uuid,
String label,
String description,
String labelAbbrev,
TermVocabulary<StatisticalMeasure> voc)
StatisticalMeasure for a given uuid by first checking if the uuid has already been used in this import, if not
checking if the StatisticalMeasure exists in the database, if not creating it anew (with vocabulary etc.).
If label, text and labelAbbrev are all null no StatisticalMeasure is created.
state - uuid - label - text - labelAbbrev -
protected Modifier getModifier(STATE state,
UUID uuid,
String label,
String description,
String labelAbbrev,
TermVocabulary<Modifier> voc)
Modifier for a given uuid by first checking if the uuid has already been used in this import, if not
checking if the Modifier exists in the database, if not creating it anew (with vocabulary etc.).
If label, text and labelAbbrev are all null no Modifier is created.
state - uuid - label - text - labelAbbrev -
protected TaxonRelationshipType getTaxonRelationshipType(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev,
TermVocabulary<TaxonRelationshipType> voc)
null no taxon relationship type is created.
state - uuid - label - text - labelAbbrev -
protected PresenceTerm getPresenceTerm(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev)
state - uuid - label - text - labelAbbrev -
protected Language getLanguage(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev)
state - uuid - label - text - labelAbbrev -
protected Language getLanguage(STATE state,
UUID uuid,
String label,
String text,
String labelAbbrev,
TermVocabulary voc)
protected <T extends DefinedTermBase> TermVocabulary<T> getVocabulary(UUID uuid,
String text,
String label,
String abbrev,
URI termSourceUri,
boolean isOrdered,
T type)
uuid -
public void addOriginalSource(CdmBase cdmBase,
Object idAttributeValue,
String namespace,
Reference citation)
rs - cdmBase - dbIdAttribute - namespace - citation -
SQLException
public void addOriginalSource(ResultSet rs,
CdmBase cdmBase,
String dbIdAttribute,
String namespace,
Reference citation)
throws SQLException
rs - cdmBase - dbIdAttribute - namespace - citation -
SQLExceptionaddOriginalSource(CdmBase, Object, String, Reference)
protected void fillMissingEpithetsForTaxa(Taxon parentTaxon,
Taxon childTaxon)
parentTaxon - childTaxon -
protected void fillMissingEpithets(NonViralName parentName,
NonViralName childName)
parentTaxon - childTaxon -
public TaxonNameDescription getTaxonNameDescription(TaxonNameBase name,
boolean isImageGallery,
boolean createNewIfNotExists)
createNewIfNotExists
is true.
createNewIfNotExists - isImageGallery - if true only taxon description being image galleries are considered.
If false only taxon description being no image galleries are considered.
public TaxonNameDescription getTaxonNameDescription(TaxonNameBase<?,?> name,
Reference ref,
boolean isImageGallery,
boolean createNewIfNotExists)
getTaxonDescription(Taxon, boolean, boolean)
Only matches a description if the given reference is a source of the description.
getTaxonDescription(Taxon, boolean, boolean)
public TaxonDescription getTaxonDescription(Taxon taxon,
boolean isImageGallery,
boolean createNewIfNotExists)
createNewIfNotExists
is true.
createNewIfNotExists - isImageGallery - if true only taxon description being image galleries are considered.
If false only taxon description being no image galleries are considered.
public TaxonDescription getTaxonDescription(Taxon taxon,
Reference ref,
boolean isImageGallery,
boolean createNewIfNotExists)
getTaxonDescription(Taxon, boolean, boolean)
Only matches a description if the given reference is a source of the description.
getTaxonDescription(Taxon, boolean, boolean)
public SpecimenDescription getSpecimenDescription(SpecimenOrObservationBase specimen,
boolean isImageGallery,
boolean createNewIfNotExists)
specimen description for a specimen or observation.
If there are multiple specimen descriptions an arbitrary one is chosen.
If no specimen description exists, a new one is created if createNewIfNotExists is true.
createNewIfNotExists - isImageGallery - if true only specimen description being image galleries are considered.
If false only specimen description being no image galleries are considered.
public SpecimenDescription getSpecimenDescription(SpecimenOrObservationBase specimen,
Reference ref,
boolean isImageGallery,
boolean createNewIfNotExists)
getSpecimenDescription(SpecimenOrObservationBase, boolean, boolean)
Only matches a description if the given reference is a source of the description.
getTaxonDescription(Taxon, boolean, boolean)
protected TextData getFeaturePlaceholder(STATE state,
DescriptionBase<?> description,
Feature feature,
boolean createIfNotExists)
state - feature - taxon - ref - createIfNotExists -
protected Taxon getAcceptedTaxon(TaxonBase<?> taxonBase)
taxon base. null is returned. If multiple accepted taxa exist the one taxon with the
same secundum reference is returned. If no such single taxon exists an
illegal state exception is thrown.
taxonBase -
protected Media getImageMedia(String uriString,
boolean readMediaData,
boolean isFigure)
throws MalformedURLException
uriString - readDataFromUrl -
MalformedURLExceptionREAD_MEDIA_DATA
protected Integer nullSafeInt(ResultSet rs,
String columnName)
throws SQLException
rs - columnName -
SQLException
protected Double nullSafeDouble(ResultSet rs,
String columnName)
throws SQLException
SQLException
protected Float nullSafeFloat(ResultSet rs,
String columnName)
throws SQLException
SQLExceptionprotected String NB(String str)
null for all blank strings. Identity function otherwise.
str -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||