import org.apache.log4j.Logger;\r
\r
import eu.etaxonomy.cdm.database.ICdmDataSource;\r
+import eu.etaxonomy.cdm.io.berlinModel.BerlinModelTransformer;\r
+import eu.etaxonomy.cdm.io.berlinModel.in.BerlinModelTaxonImport.PublishMarkerChooser;\r
+import eu.etaxonomy.cdm.io.berlinModel.in.validation.BerlinModelGeneralImportValidator;\r
import eu.etaxonomy.cdm.io.common.IImportConfigurator;\r
import eu.etaxonomy.cdm.io.common.ImportConfiguratorBase;\r
+import eu.etaxonomy.cdm.io.common.ImportStateBase;\r
import eu.etaxonomy.cdm.io.common.Source;\r
+import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer;\r
+import eu.etaxonomy.cdm.io.erms.ErmsTransformer;\r
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;\r
-import eu.etaxonomy.cdm.model.reference.Database;\r
import eu.etaxonomy.cdm.model.reference.ReferenceBase;\r
+import eu.etaxonomy.cdm.model.reference.ReferenceFactory;\r
import eu.etaxonomy.cdm.model.taxon.Synonym;\r
\r
/**\r
return new BerlinModelImportConfigurator(berlinModelSource, destination);\r
}\r
\r
+ private PublishMarkerChooser taxonPublishMarker = PublishMarkerChooser.ALL;\r
\r
+ //TODO\r
+ private static IInputTransformer defaultTransformer = null;\r
+ \r
+ \r
+ /* Max number of records to be saved with one service call */\r
+ private int recordsPerTransaction = 1000;\r
+\r
private Method namerelationshipTypeMethod;\r
private Method uuidForDefTermMethod;\r
private Method userTransformationMethod;\r
+ private Method nameTypeDesignationStatusMethod;\r
\r
private Set<Synonym> proParteSynonyms = new HashSet<Synonym>();\r
private Set<Synonym> partialSynonyms = new HashSet<Synonym>();\r
\r
protected void makeIoClassList(){\r
ioClassList = new Class[]{\r
- BerlinModelGeneralImport.class,\r
- BerlinModelUserImport.class,\r
- BerlinModelAuthorImport.class,\r
- BerlinModelAuthorTeamImport.class\r
+ BerlinModelGeneralImportValidator.class\r
+ , BerlinModelUserImport.class\r
+ , BerlinModelAuthorImport.class\r
+ , BerlinModelAuthorTeamImport.class\r
+ , BerlinModelRefDetailImport.class\r
, BerlinModelReferenceImport.class\r
, BerlinModelTaxonNameImport.class\r
, BerlinModelTaxonNameRelationImport.class\r
}; \r
}\r
\r
+ \r
+ \r
+ /* (non-Javadoc)\r
+ * @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getNewState()\r
+ */\r
+ public ImportStateBase getNewState() {\r
+ return new BerlinModelImportState(this);\r
+ }\r
+\r
+\r
+\r
/**\r
* @param berlinModelSource\r
* @param sourceReference\r
* @param destination\r
*/\r
private BerlinModelImportConfigurator(Source berlinModelSource, ICdmDataSource destination) {\r
- super();\r
+ super(defaultTransformer);\r
setNomenclaturalCode(NomenclaturalCode.ICBN); //default for Berlin Model\r
setSource(berlinModelSource);\r
setDestination(destination);\r
- setState(new BerlinModelImportState());\r
}\r
\r
\r
* @see eu.etaxonomy.cdm.io.tcsrdf.IImportConfigurator#getSourceReference()\r
*/\r
public ReferenceBase getSourceReference() {\r
+ ReferenceFactory refFactory = ReferenceFactory.newInstance();\r
if (sourceReference == null){\r
- sourceReference = Database.NewInstance();\r
+ sourceReference = refFactory.newDatabase();\r
if (getSource() != null){\r
sourceReference.setTitleCache(getSource().getDatabase());\r
}\r
public void setNamerelationshipTypeMethod(Method namerelationshipTypeMethod) {\r
this.namerelationshipTypeMethod = namerelationshipTypeMethod;\r
}\r
+ \r
+ /**\r
+ * @return the taxonPublishMarker\r
+ */\r
+ public BerlinModelTaxonImport.PublishMarkerChooser getTaxonPublishMarker() {\r
+ return taxonPublishMarker;\r
+ }\r
+\r
+ /**\r
+ * @param taxonPublishMarker the taxonPublishMarker to set\r
+ */\r
+ public void setTaxonPublishMarker(\r
+ BerlinModelTaxonImport.PublishMarkerChooser taxonPublishMarker) {\r
+ this.taxonPublishMarker = taxonPublishMarker;\r
+ }\r
+\r
+\r
\r
/**\r
* @return the uuidForDefTermMethod\r
public void setUserTransformationMethod(Method userTransformationMethod) {\r
this.userTransformationMethod = userTransformationMethod;\r
}\r
+\r
+\r
+\r
+ /**\r
+ * @return the nameTypeDesignationStatusMethod\r
+ */\r
+ public Method getNameTypeDesignationStatusMethod() {\r
+ return nameTypeDesignationStatusMethod;\r
+ }\r
+\r
+\r
+ /**\r
+ * @param nameTypeDesignationStatusMethod the nameTypeDesignationStatusMethod to set\r
+ */\r
+ public void setNameTypeDesignationStatusMethod(\r
+ Method nameTypeDesignationStatusMethod) {\r
+ this.nameTypeDesignationStatusMethod = nameTypeDesignationStatusMethod;\r
+ }\r
\r
+ /**\r
+ * @return the limitSave\r
+ */\r
+ public int getRecordsPerTransaction() {\r
+ return recordsPerTransaction;\r
+ }\r
+\r
+ /**\r
+ * @param limitSave the limitSave to set\r
+ */\r
+ public void setRecordsPerTransaction(int recordsPerTransaction) {\r
+ this.recordsPerTransaction = recordsPerTransaction;\r
+ }\r
+\r
}\r