import org.apache.log4j.Logger;\r
\r
import eu.etaxonomy.cdm.api.application.CdmApplicationController;\r
+import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;\r
import eu.etaxonomy.cdm.app.common.CdmDestinations;\r
import eu.etaxonomy.cdm.common.AccountStore;\r
import eu.etaxonomy.cdm.common.CdmUtils;\r
import eu.etaxonomy.cdm.model.agent.Person;\r
import eu.etaxonomy.cdm.model.common.Annotation;\r
import eu.etaxonomy.cdm.model.common.IdentifiableSource;\r
+import eu.etaxonomy.cdm.model.common.OriginalSourceType;\r
import eu.etaxonomy.cdm.model.media.ImageFile;\r
import eu.etaxonomy.cdm.model.media.Media;\r
import eu.etaxonomy.cdm.model.name.BotanicalName;\r
import eu.etaxonomy.cdm.model.name.TaxonNameBase;\r
+import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;\r
import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;\r
-import eu.etaxonomy.cdm.model.occurrence.Specimen;\r
-import eu.etaxonomy.cdm.model.reference.IDatabase;\r
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;\r
import eu.etaxonomy.cdm.model.reference.Reference;\r
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;\r
import eu.etaxonomy.cdm.model.taxon.Taxon;\r
if (! family.equals("Asteraceae")){\r
logger.warn("Family not Asteracea: ID= " + strId);\r
}\r
- ReferenceFactory refFactory = ReferenceFactory.newInstance();\r
- Reference sec = refFactory.newDatabase();\r
+ Reference<?> sec = ReferenceFactory.newDatabase();\r
sec.setTitleCache("Vienna Asteraceae Images", true);\r
\r
- TaxonNameBase taxonName = (BotanicalName)NonViralNameParserImpl.NewInstance().parseFullName(strTaxonName);\r
+ TaxonNameBase<?,?> taxonName = (BotanicalName)NonViralNameParserImpl.NewInstance().parseFullName(strTaxonName);\r
if (withCdm){\r
List<TaxonNameBase> names = app.getNameService().getNamesByName(strTaxonName);\r
if (names.size() == 0){\r
Taxon taxon = Taxon.NewInstance(taxonName, sec);\r
\r
logger.info("Create new specimen ...");\r
- Specimen specimen = Specimen.NewInstance();\r
+ DerivedUnit specimenx = DerivedUnit.NewPreservedSpecimenInstance();\r
+ DerivedUnitFacade specimen = DerivedUnitFacade.NewInstance(SpecimenOrObservationType.PreservedSpecimen);\r
+ \r
specimen.setCatalogNumber(catalogNumber);\r
specimen.setStoredUnder(taxonName); //??\r
//TODO\r
//specimen.setCollection(collection);\r
specimen.addAnnotation(Annotation.NewDefaultLanguageInstance(annotation));\r
specimen.addDetermination(getDetermination(taxon, strActor));\r
- specimen.addMedia(getMedia(uriPath, strId));\r
+ specimen.addDerivedUnitMedia(getMedia(uriPath, strId));\r
\r
//Original ID\r
- specimen.addSource(IdentifiableSource.NewInstance(strId));\r
+ specimen.addSource(IdentifiableSource.NewDataImportInstance(strId));\r
\r
\r
}\r