Revision 9dbe8889
Added by Andreas Müller over 2 years ago
app-import/src/main/java/eu/etaxonomy/cdm/app/cyprus/CyprusImagesActivator.java | ||
---|---|---|
43 | 43 |
import eu.etaxonomy.cdm.database.ICdmDataSource; |
44 | 44 |
import eu.etaxonomy.cdm.io.api.application.CdmIoApplicationController; |
45 | 45 |
import eu.etaxonomy.cdm.io.common.utils.ImportDeduplicationHelper; |
46 |
import eu.etaxonomy.cdm.io.mexico.SimpleExcelTaxonImportState; |
|
47 | 46 |
import eu.etaxonomy.cdm.model.agent.AgentBase; |
48 | 47 |
import eu.etaxonomy.cdm.model.agent.Institution; |
49 | 48 |
import eu.etaxonomy.cdm.model.agent.Person; |
... | ... | |
93 | 92 |
private static final String mediumPostfix ="&mo=fit&dw=400&dh=400&uvfix=1"; |
94 | 93 |
private static final String smallPostfix ="&mo=fit&dw=200&dh=200&uvfix=1"; |
95 | 94 |
|
96 |
private ImportDeduplicationHelper<SimpleExcelTaxonImportState<?>> deduplicationHelper;
|
|
95 |
private ImportDeduplicationHelper deduplicationHelper; |
|
97 | 96 |
|
98 | 97 |
private void doImport(ICdmDataSource cdmDestination){ |
99 | 98 |
|
100 | 99 |
CdmApplicationController app = CdmIoApplicationController.NewInstance(cdmDestination, DbSchemaValidation.VALIDATE); |
101 | 100 |
TransactionStatus tx = app.startTransaction(); |
102 | 101 |
|
103 |
deduplicationHelper = (ImportDeduplicationHelper)ImportDeduplicationHelper.NewInstance(app, null);
|
|
102 |
deduplicationHelper = ImportDeduplicationHelper.NewInstance(app, null); |
|
104 | 103 |
|
105 | 104 |
File file = new File(path); |
106 | 105 |
String[] fileList = file.list(); |
... | ... | |
316 | 315 |
} |
317 | 316 |
right = Rights.NewInstance(null, null, RightsType.COPYRIGHT()); |
318 | 317 |
right.setAgent(agent); |
319 |
right = deduplicationHelper.getExistingCopyright(null, right);
|
|
318 |
right = deduplicationHelper.getExistingCopyright(right); |
|
320 | 319 |
} |
321 | 320 |
|
322 | 321 |
//created |
... | ... | |
359 | 358 |
logger.warn("Person could not be parsed: " + artist + " for file " + fileName); |
360 | 359 |
} |
361 | 360 |
|
362 |
person = deduplicationHelper.getExistingAuthor(null, person);
|
|
361 |
person = deduplicationHelper.getExistingAuthor(person); |
|
363 | 362 |
return person; |
364 | 363 |
} |
365 | 364 |
|
... | ... | |
635 | 634 |
CdmApplicationController app = CdmIoApplicationController.NewInstance(cdmDestination, DbSchemaValidation.VALIDATE); |
636 | 635 |
TransactionStatus tx = app.startTransaction(); |
637 | 636 |
|
638 |
deduplicationHelper = (ImportDeduplicationHelper)ImportDeduplicationHelper.NewInstance(app, null);
|
|
637 |
deduplicationHelper = ImportDeduplicationHelper.NewInstance(app, null); |
|
639 | 638 |
|
640 | 639 |
List<Media> list = app.getMediaService().list(Media.class, null, null, null, null); |
641 | 640 |
for (Media media : list){ |
Also available in: Unified diff
ref #9890 move importDeduplicationHelper to import state and include state in helper (cont.) - appimport