// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_production_globis();\r
\r
\r
-\r
static final UUID classificationUuid = UUID.fromString("8bd27d84-fd4f-4bfa-bde0-3e6b7311b334");\r
static final UUID featureTreeUuid = UUID.fromString("33cbf7a8-0c47-4d47-bd11-b7d77a38d0f6");\r
//static final Object[] featureKeyList = new Integer[]{1,4,5,10,11,12,13,14, 249, 250, 251, 252, 253};\r
\r
static final int partitionSize = 3000;\r
\r
-\r
//NomenclaturalCode\r
static final NomenclaturalCode nomenclaturalCode = NomenclaturalCode.ICZN;\r
\r
-\r
static final boolean doReadMediaData = false;\r
\r
-// //ignore null\r
- static final boolean ignoreNull = true;\r
-\r
// ***************** ALL ************************************************//\r
\r
//authors\r
static final boolean doImages = true;\r
static final boolean doCommonNames = true;\r
\r
-\r
//******************** NONE ***************************************//\r
\r
// //authors\r
// static final boolean doImages = false;\r
// static final boolean doCommonNames = false;\r
\r
-//\r
-\r
public void doImport(Source source, ICdmDataSource destination){\r
System.out.println("Start import from ("+ globisSource.getDatabase() + ") ...");\r
\r
config.setClassificationUuid(classificationUuid);\r
config.setNomenclaturalCode(nomenclaturalCode);\r
\r
- config.setIgnoreNull(ignoreNull);\r
config.setDoReadMediaData(doReadMediaData);\r
config.setDoReferences(doReferences);\r
config.setDoAuthors(doAuthors);\r
config.setEditor(editor);\r
\r
// invoke import\r
- CdmDefaultImport<GlobisImportConfigurator> globisImport = new CdmDefaultImport<GlobisImportConfigurator>();\r
+ CdmDefaultImport<GlobisImportConfigurator> globisImport = new CdmDefaultImport<>();\r
globisImport.invoke(config);\r
\r
if (config.isDoNewUser()){\r
System.out.println("End import from ("+ source.getDatabase() + ")...");\r
}\r
\r
-\r
- /**\r
- * @param args\r
- */\r
public static void main(String[] args) {\r
\r
//make Globis Source\r
ICdmDataSource destination = CdmDestinations.chooseDestination(args) != null ? CdmDestinations.chooseDestination(args) : cdmDestination;\r
GlobisActivator me = new GlobisActivator();\r
me.doImport(source, destination);\r
-\r
}\r
-\r
-\r
}\r
* @author a.mueller\r
* @since 20.03.2008\r
*/\r
-public class BerlinModelImportConfigurator extends DbImportConfiguratorBase<BerlinModelImportState>{\r
+public class BerlinModelImportConfigurator\r
+ extends DbImportConfiguratorBase<BerlinModelImportState>{\r
+\r
private static final long serialVersionUID = 70300913255425256L;\r
\r
private static Logger logger = Logger.getLogger(BerlinModelImportConfigurator.class);\r
//references\r
private boolean doSourceNumber = false;\r
\r
+ //nullValues\r
+ private boolean ignoreNull = false;\r
+\r
//occurrences\r
private boolean isSplitTdwgCodes = true;\r
\r
};\r
}\r
\r
-\r
-\r
- /* (non-Javadoc)\r
- * @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getNewState()\r
- */\r
@Override\r
public BerlinModelImportState getNewState() {\r
return new BerlinModelImportState(this);\r
}\r
\r
-\r
-\r
- /**\r
- * @param berlinModelSource\r
- * @param sourceReference\r
- * @param destination\r
- */\r
protected BerlinModelImportConfigurator(Source berlinModelSource, ICdmDataSource destination) {\r
super(berlinModelSource, destination, NomenclaturalCode.ICNAFP, defaultTransformer); //default for Berlin Model\r
}\r
\r
-\r
/**\r
* Import name relationships yes/no?.\r
- * @return\r
*/\r
public boolean isDoRelNames() {\r
return doRelNames;\r
this.doRelNames = doRelNames;\r
}\r
\r
- /**\r
- * @return the mediaUrl\r
- */\r
public URL getMediaUrl() {\r
return mediaUrl;\r
}\r
-\r
- /**\r
- * @param mediaUrl the mediaUrl to set\r
- */\r
public void setMediaUrl(URL mediaUrl) {\r
this.mediaUrl = mediaUrl;\r
}\r
\r
- /**\r
- * @return the mediaPath\r
- */\r
public File getMediaPath() {\r
return mediaPath;\r
}\r
-\r
- /**\r
- * @param mediaPath the mediaPath to set\r
- */\r
public void setMediaPath(File mediaPath) {\r
this.mediaPath = mediaPath;\r
}\r
this.maximumNumberOfNameFacts = maximumNumberOfNameFacts;\r
}\r
\r
+ /**\r
+ * If true, no errors occur if objects are not found that should exist. This may\r
+ * be needed e.g. when only subsets of the data are imported.\r
+ * Default value is <cod>false</code>.\r
+ * @return the ignoreNull\r
+ */\r
+ public boolean isIgnoreNull() {\r
+ return ignoreNull;\r
+ }\r
+ public void setIgnoreNull(boolean ignoreNull) {\r
+ this.ignoreNull = ignoreNull;\r
+ }\r
+\r
/**\r
* If true, an authorTeam with authorTeamId = 0 is not imported (casus Salvador)\r
* @return the isIgnore0AuthorTeam\r
\r
import eu.etaxonomy.cdm.io.berlinModel.BerlinModelTransformer;\r
import eu.etaxonomy.cdm.io.berlinModel.in.validation.BerlinModelNameStatusImportValidator;\r
-import eu.etaxonomy.cdm.io.common.IImportConfigurator;\r
import eu.etaxonomy.cdm.io.common.IOValidator;\r
import eu.etaxonomy.cdm.io.common.ImportHelper;\r
import eu.etaxonomy.cdm.io.common.ResultSetPartitioner;\r
return result;\r
}\r
\r
- private boolean makeReference(IImportConfigurator config, NomenclaturalStatus nomStatus,\r
+ private boolean makeReference(BerlinModelImportConfigurator config, NomenclaturalStatus nomStatus,\r
int nameId, ResultSet rs, @SuppressWarnings("rawtypes") ResultSetPartitioner partitioner)\r
throws SQLException{\r
\r
static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql_erms();
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql_erms2();
-// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_faunaEu_mysql();
static final boolean includeExport2PESI = false;
//check - import
static final CHECK check = CHECK.IMPORT_WITHOUT_CHECK;
static final int partitionSize = 5000;
- //ignore null
- static final boolean ignoreNull = true;
// ***************** ALL ************************************************//
config.setClassificationUuid(classificationUuid);
- config.setIgnoreNull(ignoreNull);
config.setDoReferences(doReferences);
config.setDoTaxa(doTaxa);