import org.springframework.transaction.TransactionStatus;\r
\r
import eu.etaxonomy.cdm.io.berlinModel.out.mapper.CreatedAndNotesMapper;\r
+import eu.etaxonomy.cdm.io.berlinModel.out.mapper.DbExtensionMapper;\r
import eu.etaxonomy.cdm.io.berlinModel.out.mapper.DbStringMapper;\r
import eu.etaxonomy.cdm.io.berlinModel.out.mapper.DbTimePeriodMapper;\r
import eu.etaxonomy.cdm.io.berlinModel.out.mapper.IdMapper;\r
-import eu.etaxonomy.cdm.io.common.IExportConfigurator;\r
import eu.etaxonomy.cdm.io.common.Source;\r
import eu.etaxonomy.cdm.model.agent.AgentBase;\r
import eu.etaxonomy.cdm.model.agent.Person;\r
import eu.etaxonomy.cdm.model.common.CdmBase;\r
+import eu.etaxonomy.cdm.model.common.ExtensionType;\r
\r
\r
/**\r
public class BerlinModelAuthorExport extends BerlinModelExportBase<Person> {\r
private static final Logger logger = Logger.getLogger(BerlinModelAuthorExport.class);\r
\r
- private static int modCount = 1000;\r
+ private static int modCount = 5000;\r
private static final String dbTableName = "Author";\r
private static final String pluralString = "Authors";\r
private static final Class<? extends CdmBase> standardMethodParameter = Person.class;\r
super();\r
}\r
\r
- /* (non-Javadoc)\r
- * @see eu.etaxonomy.cdm.io.common.CdmIoBase#doCheck(eu.etaxonomy.cdm.io.common.IImportConfigurator)\r
- */\r
+\r
@Override\r
- protected boolean doCheck(IExportConfigurator config){\r
+ protected boolean doCheck(BerlinModelExportState state){\r
boolean result = true;\r
logger.warn("Checking for "+pluralString+" not yet implemented");\r
//result &= checkArticlesWithoutJournal(bmiConfig);\r
mapping.addMapper(DbStringMapper.NewInstance("firstname", "FirstName"));\r
mapping.addMapper(DbStringMapper.NewInstance("lastname", "LastName"));\r
mapping.addMapper(DbTimePeriodMapper.NewInstance("lifespan", "Dates"));\r
-\r
-//TODO \r
-// mapping.addMapper(DbStringMapper.NewInstance("", "NomStandard"));\r
-// mapping.addMapper(DbStringMapper.NewInstance("", "Kürzel"));\r
-// mapping.addMapper(DbStringMapper.NewInstance("", "DraftKürz"));\r
-// mapping.addMapper(DbStringMapper.NewInstance("", "Initials"));\r
-\r
+ mapping.addMapper(DbExtensionMapper.NewInstance(ExtensionType.NOMENCLATURAL_STANDARD(), "NomStandard"));\r
+ mapping.addMapper(DbExtensionMapper.NewInstance(ExtensionType.AREA_OF_INTREREST(), "AreaOfInterest"));\r
+ mapping.addMapper(DbExtensionMapper.NewInstance(ExtensionType.ABBREVIATION(), "Initials"));\r
+// mapping.addMapper(DbExtensionMapper.NewInstance(ExtensionType.ABBREVIATION(),Kürzel")); //Initials used instead\r
+// mapping.addMapper(DbExtensionMapper.NewInstance(ExtensionType.ABBREVIATION(), "DraftKürz")); //Initials used instead\r
mapping.addMapper(CreatedAndNotesMapper.NewInstance());\r
\r
return mapping;\r
}\r
\r
- \r
- protected boolean doInvoke(BerlinModelExportState<BerlinModelExportConfigurator> state){\r
+ /* (non-Javadoc)\r
+ * @see eu.etaxonomy.cdm.io.berlinModel.out.BerlinModelExportBase#doInvoke(eu.etaxonomy.cdm.io.berlinModel.out.BerlinModelExportState)\r
+ */\r
+ @Override\r
+ protected boolean doInvoke(BerlinModelExportState state) {\r
try{\r
BerlinModelExportConfigurator bmeConfig = (BerlinModelExportConfigurator)state.getConfig();\r
\r
\r
TransactionStatus txStatus = startTransaction(true);\r
Class<Person> clazz = Person.class;\r
- List<? extends Person> persons = getAgentService().list(clazz, 100000000, 0);\r
+ List<AgentBase> persons = getAgentService().list(clazz, 100000000, 0, null, null);\r
\r
BerlinModelExportMapping mapping = getMapping();\r
mapping.initialize(state);\r
}\r
\r
commitTransaction(txStatus);\r
- logger.info("end make "+pluralString+" ...");\r
+ logger.info("end make "+pluralString+" ..." + getSuccessString(success));\r
return success;\r
}catch(SQLException e){\r
e.printStackTrace();\r
return true;\r
}\r
\r
+ \r
/* (non-Javadoc)\r
- * @see eu.etaxonomy.cdm.io.common.CdmIoBase#isIgnore(eu.etaxonomy.cdm.io.common.IImportConfigurator)\r
+ * @see eu.etaxonomy.cdm.io.common.CdmIoBase#isIgnore(eu.etaxonomy.cdm.io.common.IIoConfigurator)\r
*/\r
- protected boolean isIgnore(IExportConfigurator config){\r
- return ! ((BerlinModelExportConfigurator)config).isDoAuthors();\r
+ @Override\r
+ protected boolean isIgnore(BerlinModelExportState state) {\r
+ return ! state.getConfig().isDoAuthors();\r
}\r
\r
/* (non-Javadoc)\r
return standardMethodParameter;\r
}\r
\r
+\r
+\r
}\r