import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
-import eu.etaxonomy.cdm.model.name.ZoologicalName;
import eu.etaxonomy.cdm.model.occurrence.Collection;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
//check atomised name data for rank
//new name will be created
- NonViralName<?> atomisedTaxonName = null;
+ TaxonNameBase<?,?> atomisedTaxonName = null;
if (rank==null && unitIndexInAbcdFile>=0 && ((state.getDataHolder().getAtomisedIdentificationList() != null && !state.getDataHolder().getAtomisedIdentificationList().isEmpty())|| state.getDataHolder().getAtomisedIdentificationList().size() > 0)) {
atomisedTaxonName = setTaxonNameByType(state.getDataHolder().getAtomisedIdentificationList().get(unitIndexInAbcdFile), scientificName, state);
if(atomisedTaxonName!=null){
}
}
if(config.isReuseExistingTaxaWhenPossible()){
- NonViralName<?> parsedName = atomisedTaxonName;
+ TaxonNameBase<?,?> parsedName = atomisedTaxonName;
if(parsedName==null){
parsedName = parseScientificName(scientificName, state, state.getReport());
}
* @param report the import report
* @return a parsed name
*/
- protected NonViralName<?> parseScientificName(String scientificName, STATE state, SpecimenImportReport report) {
+ protected TaxonNameBase<?,?> parseScientificName(String scientificName, STATE state, SpecimenImportReport report) {
NonViralNameParserImpl nvnpi = NonViralNameParserImpl.NewInstance();
- NonViralName<?> taxonName = null;
+ TaxonNameBase<?,?> taxonName = null;
boolean problem = false;
if(DEBUG){
* @param state
* @return the corresponding Botanical or Zoological or... name
*/
- protected NonViralName<?> setTaxonNameByType(
+ protected TaxonNameBase<?,?> setTaxonNameByType(
HashMap<String, String> atomisedMap, String fullName, STATE state) {
boolean problem = false;
if(DEBUG) {
}
if (state.getDataHolder().getNomenclatureCode().equals("Zoological") || state.getDataHolder().getNomenclatureCode().equals(NomenclaturalCode.ICZN.getUuid())) {
- NonViralName<ZoologicalName> taxonName = TaxonNameBase.NewZoologicalInstance(null);
+ TaxonNameBase<?,?> taxonName = TaxonNameBase.NewZoologicalInstance(null);
taxonName.setFullTitleCache(fullName, true);
taxonName.setGenusOrUninomial(NB(getFromMap(atomisedMap, "Genus")));
taxonName.setInfraGenericEpithet(NB(getFromMap(atomisedMap, "SubGenus")));
if (problem) {
logger.info("Problem im setTaxonNameByType ");
- NonViralName<?> taxonName = TaxonNameBase.NewNonViralInstance(null);
+ TaxonNameBase<?,?> taxonName = TaxonNameBase.NewNonViralInstance(null);
taxonName.setFullTitleCache(fullName, true);
return taxonName;
}
- NonViralName<?> tn = TaxonNameBase.NewNonViralInstance(null);
+ TaxonNameBase<?,?> tn = TaxonNameBase.NewNonViralInstance(null);
return tn;
}
* @param names
* @param item
*/
-private TaxonNameBase findBestMatchingNames(GbifResponse item, SpecimenImportStateBase state) {
+private TaxonNameBase<?,?> findBestMatchingNames(GbifResponse item, SpecimenImportStateBase state) {
//TODO
if (item.getScientificName() != null){
List<NonViralName> names = findExistingNames(item.getScientificName().getNameCache(), state);
if (!names.isEmpty()){
- NonViralName<?> result = names.get(0);
+ TaxonNameBase<?,?> result = names.get(0);
Set<DeterminationEvent> detEvents = item.getDerivedUnitFacade().baseUnit().getDeterminations();
for (DeterminationEvent event:detEvents){
if(event.getTaxonName().getNameCache().equals(result.getNameCache()) ){
import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
import eu.etaxonomy.cdm.model.description.TaxonDescription;
import eu.etaxonomy.cdm.model.description.TextData;
-import eu.etaxonomy.cdm.model.name.NonViralName;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
import eu.etaxonomy.cdm.model.reference.Reference;
* @param refMods
* @param nameToBeFilled
*/
- protected void addSource(Reference refMods, NonViralName<?> nameToBeFilled) {
+ protected void addSource(Reference refMods, TaxonNameBase<?,?> nameToBeFilled) {
//logger.info("addSource");
sourceUrlRef=CdmBase.deproxy(sourceUrlRef, Reference.class);
Reference sec = CdmBase.deproxy(configState.getConfig().getSecundum(), Reference.class);
* @param acceptedTaxon: the current accepted Taxon
* @param refMods: the current reference extracted from the MODS
*/
- private String extractMaterialsDirect(Node materials, Taxon acceptedTaxon, Reference refMods, String event, NonViralName<?> currentName) {
+ private String extractMaterialsDirect(Node materials, Taxon acceptedTaxon, Reference refMods, String event, TaxonNameBase<?,?> currentName) {
logger.info("extractMaterialsDirect");
// logger.info("acceptedTaxon: "+acceptedTaxon);
String descr="";
s = askSetParent(s);
r = askRank(s,rankListStr);
- NonViralName<?> nameToBeFilled = null;
+ TaxonNameBase<?,?> nameToBeFilled = null;
if (nomenclaturalCode.equals(NomenclaturalCode.ICNAFP)){
nameToBeFilled = TaxonNameBase.NewBotanicalInstance(null);
}
logger.info("doGetNameInformation()" + request.getRequestURI() + " for name uuid \""
+ nameUuid + "\"");
// find name by uuid
- NonViralName<?> nvn = CdmBase.deproxy(service.load(UUID.fromString(nameUuid),
- NAME_INFORMATION_INIT_STRATEGY), NonViralName.class);
+ TaxonNameBase<?,?> nvn = service.load(UUID.fromString(nameUuid),NAME_INFORMATION_INIT_STRATEGY);
// if search is successful then get related information, else return error
if (nvn != null) {
package eu.etaxonomy.cdm.remote.view.oaipmh.dwc;\r
\r
-import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;\r
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;\r
-import eu.etaxonomy.cdm.model.name.NonViralName;\r
+import eu.etaxonomy.cdm.model.name.INonViralName;\r
import eu.etaxonomy.cdm.model.taxon.Taxon;\r
import eu.etaxonomy.cdm.remote.dto.dwc.SimpleDarwinRecord;\r
import eu.etaxonomy.cdm.remote.dto.oaipmh.Metadata;\r
\r
public class GetRecordView extends eu.etaxonomy.cdm.remote.view.oaipmh.ListRecordsView {\r
- \r
+\r
\r
@Override\r
public void constructMetadata(Metadata metadata, IdentifiableEntity identifiableEntity) {\r
- SimpleDarwinRecord dc = (SimpleDarwinRecord)mapper.map(identifiableEntity, SimpleDarwinRecord.class);\r
+ SimpleDarwinRecord dc = mapper.map(identifiableEntity, SimpleDarwinRecord.class);\r
if(identifiableEntity instanceof Taxon){\r
- NonViralName<?> name = HibernateProxyHelper.deproxy(((Taxon)identifiableEntity).getName(), NonViralName.class);\r
+ INonViralName name = ((Taxon)identifiableEntity).getName();\r
mapper.map(name, dc);\r
}\r
dc.setBasisOfRecord("Taxon");\r
import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
import eu.etaxonomy.cdm.model.name.HybridRelationship;
import eu.etaxonomy.cdm.model.name.HybridRelationshipType;
+import eu.etaxonomy.cdm.model.name.INonViralName;
import eu.etaxonomy.cdm.model.name.NameRelationship;
import eu.etaxonomy.cdm.model.name.NameRelationshipType;
import eu.etaxonomy.cdm.model.name.NameTypeDesignation;
@Override
protected void setOtherCachesNull(TaxonNameBase name) {
- if (name.isInstanceOf(NonViralName.class)){
- NonViralName<?> nvn = CdmBase.deproxy(name, NonViralName.class);
- if (! nvn.isProtectedNameCache()){
- nvn.setNameCache(null, false);
- }
- if (! nvn.isProtectedAuthorshipCache()){
- nvn.setAuthorshipCache(null, false);
- }
- if (! nvn.isProtectedFullTitleCache()){
- nvn.setFullTitleCache(null, false);
- }
+ if (! name.isProtectedNameCache()){
+ name.setNameCache(null, false);
}
+ if (! name.isProtectedAuthorshipCache()){
+ name.setAuthorshipCache(null, false);
+ }
+ if (! name.isProtectedFullTitleCache()){
+ name.setFullTitleCache(null, false);
+ }
+
}
@Override
//hybrid relationships
if (name.isInstanceOf(NonViralName.class)){
- NonViralName nvn = CdmBase.deproxy(name, NonViralName.class);
+ INonViralName nvn = name;
Set<HybridRelationship> parentHybridRelations = nvn.getHybridParentRelations();
//Hibernate.initialize(parentHybridRelations);
if (! parentHybridRelations.isEmpty()){
import eu.etaxonomy.cdm.api.service.pager.Pager;
import eu.etaxonomy.cdm.api.service.search.ICdmMassIndexer;
import eu.etaxonomy.cdm.common.UTF8;
-import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
import eu.etaxonomy.cdm.model.common.Language;
import eu.etaxonomy.cdm.model.description.CommonTaxonName;
nameCache = ((NonViralName<?>) list.get(i)).getNameCache();
} else if (list.get(i) instanceof TaxonBase) {
TaxonNameBase<?,?> taxonNameBase = ((TaxonBase) list.get(i)).getName();
- nameCache = HibernateProxyHelper.deproxy(taxonNameBase, NonViralName.class).getNameCache();
+ nameCache = taxonNameBase.getNameCache();
} else {
}
logger.log(level, list.get(i).getClass() + "(" + i + ")" + ": Name Cache = " + nameCache + ", Title Cache = "