protected ICdmApplicationConfiguration applicationConfiguration;
public static enum TYPE {
- Jaxb, Tcs, Excel_Taxa, Endnote, Sdd, Abcd, SpecimenCdmExcel, Excel_Name
+ Jaxb, Tcs, Excel_Taxa, Endnote, Sdd, Abcd, SpecimenCdmExcel, Excel_Name, SpecimenSearch
}
/**
}
+ public void runMoniteredOperation(IImportConfigurator configurator, SOURCE_TYPE type) {
+ byte[] data = new byte[1];
+ try {
+ runMoniteredOperation(configurator, data, type);
+ } catch (Exception e) {
+ MessagingUtils.errorDialog("Error importing input stream",
+ this,
+ e.getMessage(),
+ TaxeditorStorePlugin.PLUGIN_ID,
+ e,
+ true);
+ }
+
+ }
+
public void runMoniteredOperation(IImportConfigurator configurator, File importFile, SOURCE_TYPE type) {
Path path = Paths.get(importFile.toURI());
try {
return SDDImportConfigurator.NewInstance(null, null);
case SpecimenCdmExcel:
return SpecimenCdmExcelImportConfigurator.NewInstance(null, null);
+ case SpecimenSearch:
+ return Abcd206ImportConfigurator.NewInstance(null, null);
default:
MessagingUtils.notImplementedMessage(this);
throw new IllegalArgumentException("Import not supported yet");
private static final Logger logger = Logger.getLogger(AbcdImportWizard.class);
private Abcd206ImportConfigurator configurator;
- private ImportFromFileDataSourceWizardPage dataSourcePage;
+ private AbcdSourceSelectionPage dataSourcePage;
private ClassificationChooserWizardPage classificationChooserWizardPage;
/** {@inheritDoc} */
super.addPages();
classificationChooserWizardPage = ClassificationChooserWizardPage.createPage();
+
dataSourcePage = ImportFromFileDataSourceWizardPage.XML();
+
addPage(classificationChooserWizardPage);
addPage(dataSourcePage);
}
import java.io.File;
import java.net.URI;
-import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
* @created 04.08.2009
* @version 1.0
*/
-public class ImportFromFileDataSourceWizardPage extends WizardPage {
+public class ImportFromFileDataSourceWizardPage extends AbcdSourceSelectionPage {
/** Constant <code>PAGE_NAME="CdmXmlDataSourceWizardPage"</code> */
public static final String PAGE_NAME = "CdmXmlDataSourceWizardPage";
private FileDialog fileDialog;
- private Text text_file;
+
protected ImportFromFileDataSourceWizardPage(String title, String description, String[] extensions) {
super(PAGE_NAME);
fileDialog.setFilterExtensions(extensions);
- text_file = new Text(composite, SWT.BORDER);
- text_file.setEditable(false);
- text_file.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ text_source = new Text(composite, SWT.BORDER);
+ text_source.setEditable(false);
+ text_source.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
Button button = new Button(composite, SWT.PUSH);
public void widgetSelected(SelectionEvent e) {
String path = fileDialog.open();
if(path!=null){
- text_file.setText(path);
+ text_source.setText(path);
setPageComplete(true);
}
}
}
public File getFile() {
- return new File(text_file.getText());
+ return new File(text_source.getText());
}
- public URI getUri() {
+ @Override
+ public URI getUri() {
return getFile().toURI();
}
@Override
public boolean isPageComplete() {
- return CdmUtils.isNotBlank(text_file.getText());
+ return CdmUtils.isNotBlank(text_source.getText());
}
}
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-package eu.etaxonomy.taxeditor.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
import java.util.Collection;
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-package eu.etaxonomy.taxeditor.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
import java.util.Collection;
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-package eu.etaxonomy.taxeditor.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
import java.util.ArrayList;
import java.util.Collection;
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-package eu.etaxonomy.taxeditor.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifResponse;
*/
public class GbifImportEditor extends DataImportEditor<GbifResponse>{
- public static final String ID = "eu.etaxonomy.taxeditor.editor.view.dataimport.GbifImportEditor";
+ public static final String ID = "eu.etaxonomy.taxeditor.view.dataimport.GbifImportEditor";
/**
* Required for extension point
}
/* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportEditor#getTextForTableItem(java.lang.Object)
+ * @see eu.etaxonomy.taxeditor.view.dataimport.DataImportEditor#getTextForTableItem(java.lang.Object)
*/
@Override
protected String getTextForTableItem(GbifResponse item) {
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-package eu.etaxonomy.taxeditor.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
import java.io.IOException;
import java.net.URISyntaxException;
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-package eu.etaxonomy.taxeditor.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
import java.io.IOException;
import java.net.URISyntaxException;
public class GbifResponseImportView extends DataImportView<GbifResponse> {
- public static final String ID = "eu.etaxonomy.taxeditor.editor.view.dataimport.GbifResponseImportView";
+ public static final String ID = "eu.etaxonomy.taxeditor.view.dataimport.GbifResponseImportView";
/* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportView#getTextForTableItem(java.lang.Object)
+ * @see eu.etaxonomy.taxeditor.view.dataimport.DataImportView#getTextForTableItem(java.lang.Object)
*/
@Override
protected String getTextForTableItem(GbifResponse item) {
}
/* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportView#query()
+ * @see eu.etaxonomy.taxeditor.view.dataimport.DataImportView#query()
*/
@Override
public void query() {
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-package eu.etaxonomy.taxeditor.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
/**
* Enumeration of possible specimen provider types
-package eu.etaxonomy.taxeditor.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
import org.apache.log4j.Logger;
import org.eclipse.jface.action.Action;
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-package eu.etaxonomy.taxeditor.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
*/
public class SpecimenImportEditor extends DataImportEditor<SpecimenOrObservationBase<?>> {
- public static final String ID = "eu.etaxonomy.taxeditor.editor.view.dataimport.SpecimenImportEditor";
+ public static final String ID = "eu.etaxonomy.taxeditor.view.dataimport.SpecimenImportEditor";
/**
* Required for extension point
}
/* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportEditor#getTextForTableItem(eu.etaxonomy.cdm.model.common.IIdentifiableEntity)
+ * @see eu.etaxonomy.taxeditor.view.dataimport.DataImportEditor#getTextForTableItem(eu.etaxonomy.cdm.model.common.IIdentifiableEntity)
*/
@Override
protected String getTextForTableItem(SpecimenOrObservationBase<?> item) {
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-package eu.etaxonomy.taxeditor.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
import java.net.MalformedURLException;
import java.net.URI;
private SpecimenProviderSelectionController specimenProviderSelectionController;
private URI endPoint;
- protected SpecimenProviderSelectionWizardPage(String pageName) {
+ public SpecimenProviderSelectionWizardPage(String pageName) {
super(pageName);
setTitle("Select Specimen Provider");
setDescription("Select the provider to query for specimens.\nTo query a BioCASE " +
}
+
+
}
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-package eu.etaxonomy.taxeditor.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
import java.util.Calendar;