Project

General

Profile

« Previous | Next » 

Revision 7563a18e

Added by Katja Luther about 6 years ago

minor

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/AbstractIOManager.java
30 30
	protected ICdmApplicationConfiguration applicationConfiguration;
31 31

  
32 32
	public static enum TYPE {
33
		Jaxb, Tcs, Excel_Taxa, Endnote, Sdd, Abcd, SpecimenCdmExcel, Excel_Name
33
		Jaxb, Tcs, Excel_Taxa, Endnote, Sdd, Abcd, SpecimenCdmExcel, Excel_Name, SpecimenSearch
34 34
	}
35 35

  
36 36
	/**
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ImportManager.java
234 234

  
235 235
    }
236 236

  
237
    public void runMoniteredOperation(IImportConfigurator configurator, SOURCE_TYPE type) {
238
        byte[] data = new byte[1];
239
        try {
240
            runMoniteredOperation(configurator, data, type);
241
        } catch (Exception e) {
242
            MessagingUtils.errorDialog("Error importing input stream",
243
                    this,
244
                    e.getMessage(),
245
                    TaxeditorStorePlugin.PLUGIN_ID,
246
                    e,
247
                    true);
248
        }
249

  
250
    }
251

  
237 252
    public void runMoniteredOperation(IImportConfigurator configurator, File importFile, SOURCE_TYPE type) {
238 253
        Path path = Paths.get(importFile.toURI());
239 254
        try {
......
285 300
			return SDDImportConfigurator.NewInstance(null, null);
286 301
		case SpecimenCdmExcel:
287 302
			return SpecimenCdmExcelImportConfigurator.NewInstance(null, null);
303
		case SpecimenSearch:
304
		    return Abcd206ImportConfigurator.NewInstance(null, null);
288 305
		default:
289 306
			MessagingUtils.notImplementedMessage(this);
290 307
			throw new IllegalArgumentException("Import not supported yet");
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbcdImportWizard.java
37 37
    private static final Logger logger = Logger.getLogger(AbcdImportWizard.class);
38 38

  
39 39
	private Abcd206ImportConfigurator configurator;
40
	private ImportFromFileDataSourceWizardPage dataSourcePage;
40
	private AbcdSourceSelectionPage dataSourcePage;
41 41
	private ClassificationChooserWizardPage classificationChooserWizardPage;
42 42

  
43 43
	/** {@inheritDoc} */
......
87 87
		super.addPages();
88 88

  
89 89
		classificationChooserWizardPage = ClassificationChooserWizardPage.createPage();
90

  
90 91
		dataSourcePage = ImportFromFileDataSourceWizardPage.XML();
92

  
91 93
		addPage(classificationChooserWizardPage);
92 94
		addPage(dataSourcePage);
93 95
	}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ImportFromFileDataSourceWizardPage.java
13 13
import java.io.File;
14 14
import java.net.URI;
15 15

  
16
import org.eclipse.jface.wizard.WizardPage;
17 16
import org.eclipse.swt.SWT;
18 17
import org.eclipse.swt.events.SelectionAdapter;
19 18
import org.eclipse.swt.events.SelectionEvent;
......
33 32
 * @created 04.08.2009
34 33
 * @version 1.0
35 34
 */
36
public class ImportFromFileDataSourceWizardPage extends WizardPage {
35
public class ImportFromFileDataSourceWizardPage extends AbcdSourceSelectionPage {
37 36

  
38 37
	/** Constant <code>PAGE_NAME="CdmXmlDataSourceWizardPage"</code> */
39 38
	public static final String PAGE_NAME = "CdmXmlDataSourceWizardPage";
......
42 41

  
43 42
	private FileDialog fileDialog;
44 43

  
45
	private Text text_file;
44

  
46 45

  
47 46
	protected ImportFromFileDataSourceWizardPage(String title, String description, String[] extensions) {
48 47
		super(PAGE_NAME);
......
76 75

  
77 76
		fileDialog.setFilterExtensions(extensions);
78 77

  
79
		text_file = new Text(composite, SWT.BORDER);
80
		text_file.setEditable(false);
81
		text_file.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
78
		text_source = new Text(composite, SWT.BORDER);
79
		text_source.setEditable(false);
80
		text_source.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
82 81

  
83 82

  
84 83
		Button button = new Button(composite, SWT.PUSH);
......
90 89
			public void widgetSelected(SelectionEvent e) {
91 90
				String path = fileDialog.open();
92 91
				if(path!=null){
93
				    text_file.setText(path);
92
				    text_source.setText(path);
94 93
				    setPageComplete(true);
95 94
				}
96 95
			}
......
102 101
	}
103 102

  
104 103
	public File getFile() {
105
		return new File(text_file.getText());
104
		return new File(text_source.getText());
106 105
	}
107 106

  
108
	public URI getUri() {
107
	@Override
108
    public URI getUri() {
109 109
		return getFile().toURI();
110 110
	}
111 111

  
112 112
	@Override
113 113
	public boolean isPageComplete() {
114
		return CdmUtils.isNotBlank(text_file.getText());
114
		return CdmUtils.isNotBlank(text_source.getText());
115 115
	}
116 116

  
117 117
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/DataImportEditor.java
7 7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8 8
* See LICENSE.TXT at the top of this package for the full license terms.
9 9
*/
10
package eu.etaxonomy.taxeditor.editor.view.dataimport;
10
package eu.etaxonomy.taxeditor.view.dataimport;
11 11

  
12 12
import java.util.Collection;
13 13

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/DataImportEditorInput.java
7 7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8 8
* See LICENSE.TXT at the top of this package for the full license terms.
9 9
*/
10
package eu.etaxonomy.taxeditor.editor.view.dataimport;
10
package eu.etaxonomy.taxeditor.view.dataimport;
11 11

  
12 12
import java.util.Collection;
13 13

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/DataImportView.java
7 7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8 8
* See LICENSE.TXT at the top of this package for the full license terms.
9 9
*/
10
package eu.etaxonomy.taxeditor.editor.view.dataimport;
10
package eu.etaxonomy.taxeditor.view.dataimport;
11 11

  
12 12
import java.util.ArrayList;
13 13
import java.util.Collection;
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/GbifImportEditor.java
7 7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8 8
* See LICENSE.TXT at the top of this package for the full license terms.
9 9
*/
10
package eu.etaxonomy.taxeditor.editor.view.dataimport;
10
package eu.etaxonomy.taxeditor.view.dataimport;
11 11

  
12 12
import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifResponse;
13 13

  
......
18 18
 */
19 19
public class GbifImportEditor extends DataImportEditor<GbifResponse>{
20 20

  
21
    public static final String ID = "eu.etaxonomy.taxeditor.editor.view.dataimport.GbifImportEditor";
21
    public static final String ID = "eu.etaxonomy.taxeditor.view.dataimport.GbifImportEditor";
22 22

  
23 23
    /**
24 24
     * Required for extension point
......
28 28
    }
29 29

  
30 30
    /* (non-Javadoc)
31
     * @see eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportEditor#getTextForTableItem(java.lang.Object)
31
     * @see eu.etaxonomy.taxeditor.view.dataimport.DataImportEditor#getTextForTableItem(java.lang.Object)
32 32
     */
33 33
    @Override
34 34
    protected String getTextForTableItem(GbifResponse item) {
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/GbifImportEditorInput.java
7 7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8 8
* See LICENSE.TXT at the top of this package for the full license terms.
9 9
*/
10
package eu.etaxonomy.taxeditor.editor.view.dataimport;
10
package eu.etaxonomy.taxeditor.view.dataimport;
11 11

  
12 12
import java.io.IOException;
13 13
import java.net.URISyntaxException;
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/GbifResponseImportView.java
7 7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8 8
* See LICENSE.TXT at the top of this package for the full license terms.
9 9
*/
10
package eu.etaxonomy.taxeditor.editor.view.dataimport;
10
package eu.etaxonomy.taxeditor.view.dataimport;
11 11

  
12 12
import java.io.IOException;
13 13
import java.net.URISyntaxException;
......
26 26
public class GbifResponseImportView extends DataImportView<GbifResponse> {
27 27

  
28 28

  
29
    public static final String ID = "eu.etaxonomy.taxeditor.editor.view.dataimport.GbifResponseImportView";
29
    public static final String ID = "eu.etaxonomy.taxeditor.view.dataimport.GbifResponseImportView";
30 30

  
31 31
    /* (non-Javadoc)
32
     * @see eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportView#getTextForTableItem(java.lang.Object)
32
     * @see eu.etaxonomy.taxeditor.view.dataimport.DataImportView#getTextForTableItem(java.lang.Object)
33 33
     */
34 34
    @Override
35 35
    protected String getTextForTableItem(GbifResponse item) {
......
42 42
    }
43 43

  
44 44
    /* (non-Javadoc)
45
     * @see eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportView#query()
45
     * @see eu.etaxonomy.taxeditor.view.dataimport.DataImportView#query()
46 46
     */
47 47
    @Override
48 48
    public void query() {
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/QueryType.java
7 7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8 8
* See LICENSE.TXT at the top of this package for the full license terms.
9 9
*/
10
package eu.etaxonomy.taxeditor.editor.view.dataimport;
10
package eu.etaxonomy.taxeditor.view.dataimport;
11 11

  
12 12
/**
13 13
 * Enumeration of possible specimen provider types
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/SaveImportedSpecimenAction.java
1
package eu.etaxonomy.taxeditor.editor.view.dataimport;
1
package eu.etaxonomy.taxeditor.view.dataimport;
2 2

  
3 3
import org.apache.log4j.Logger;
4 4
import org.eclipse.jface.action.Action;
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/SpecimenImportEditor.java
7 7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8 8
* See LICENSE.TXT at the top of this package for the full license terms.
9 9
*/
10
package eu.etaxonomy.taxeditor.editor.view.dataimport;
10
package eu.etaxonomy.taxeditor.view.dataimport;
11 11

  
12 12
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
13 13

  
......
19 19
 */
20 20
public class SpecimenImportEditor extends DataImportEditor<SpecimenOrObservationBase<?>> {
21 21

  
22
    public static final String ID = "eu.etaxonomy.taxeditor.editor.view.dataimport.SpecimenImportEditor";
22
    public static final String ID = "eu.etaxonomy.taxeditor.view.dataimport.SpecimenImportEditor";
23 23

  
24 24
    /**
25 25
     * Required for extension point
......
29 29
    }
30 30

  
31 31
    /* (non-Javadoc)
32
     * @see eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportEditor#getTextForTableItem(eu.etaxonomy.cdm.model.common.IIdentifiableEntity)
32
     * @see eu.etaxonomy.taxeditor.view.dataimport.DataImportEditor#getTextForTableItem(eu.etaxonomy.cdm.model.common.IIdentifiableEntity)
33 33
     */
34 34
    @Override
35 35
    protected String getTextForTableItem(SpecimenOrObservationBase<?> item) {
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/SpecimenProviderSelectionWizardPage.java
7 7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8 8
* See LICENSE.TXT at the top of this package for the full license terms.
9 9
*/
10
package eu.etaxonomy.taxeditor.editor.view.dataimport;
10
package eu.etaxonomy.taxeditor.view.dataimport;
11 11

  
12 12
import java.net.MalformedURLException;
13 13
import java.net.URI;
......
31 31
    private SpecimenProviderSelectionController specimenProviderSelectionController;
32 32
    private URI endPoint;
33 33

  
34
    protected SpecimenProviderSelectionWizardPage(String pageName) {
34
    public SpecimenProviderSelectionWizardPage(String pageName) {
35 35
        super(pageName);
36 36
        setTitle("Select Specimen Provider");
37 37
        setDescription("Select the provider to query for specimens.\nTo query a BioCASE " +
......
98 98
    }
99 99

  
100 100

  
101

  
102

  
101 103
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/SpecimenSearchWizardPage.java
7 7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8 8
* See LICENSE.TXT at the top of this package for the full license terms.
9 9
*/
10
package eu.etaxonomy.taxeditor.editor.view.dataimport;
10
package eu.etaxonomy.taxeditor.view.dataimport;
11 11

  
12 12
import java.util.Calendar;
13 13

  

Also available in: Unified diff