Revision 66eb9f49
Added by Andreas Müller over 3 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/ImportFromFileDataSourceWithReferenceWizardPage.java | ||
---|---|---|
18 | 18 |
import org.eclipse.swt.widgets.Text; |
19 | 19 |
|
20 | 20 |
/** |
21 |
* |
|
22 | 21 |
* @author pplitzner |
23 | 22 |
* @since Oct 5, 2017 |
24 |
* |
|
25 | 23 |
*/ |
26 | 24 |
public class ImportFromFileDataSourceWithReferenceWizardPage extends ImportFromFileDataSourceWizardPage { |
27 | 25 |
|
... | ... | |
32 | 30 |
super(); |
33 | 31 |
} |
34 | 32 |
|
35 |
/** {@inheritDoc} */ |
|
36 | 33 |
@Override |
37 | 34 |
public void createControl(Composite parent) { |
38 | 35 |
super.createControl(parent); |
... | ... | |
53 | 50 |
public void setTextReferenceString(Text textReferenceString) { |
54 | 51 |
this.textReferenceString = textReferenceString; |
55 | 52 |
} |
56 |
|
|
57 |
} |
|
53 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/ImportFromFileDataSourceWizardPage.java | ||
---|---|---|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
9 |
|
|
10 | 9 |
package eu.etaxonomy.taxeditor.io.e4.in; |
11 | 10 |
|
12 | 11 |
import java.io.File; |
... | ... | |
112 | 111 |
public boolean isPageComplete() { |
113 | 112 |
return CdmUtils.isNotBlank(text_source.getText()); |
114 | 113 |
} |
115 |
|
|
116 |
} |
|
114 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/sdd/SddImportWizardE4.java | ||
---|---|---|
27 | 27 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
28 | 28 |
|
29 | 29 |
/** |
30 |
* |
|
31 | 30 |
* @author pplitzner |
32 | 31 |
* @since Oct 5, 2017 |
33 |
* |
|
34 | 32 |
*/ |
35 | 33 |
public class SddImportWizardE4 extends AbstractImportWizardE4<SDDImportConfigurator> { |
36 | 34 |
|
37 |
|
|
38 | 35 |
private SDDImportConfigurator configurator; |
39 | 36 |
|
40 | 37 |
private ImportFromFileDataSourceWithReferenceWizardPage dataSourcePage; |
... | ... | |
44 | 41 |
super(context, partService); |
45 | 42 |
} |
46 | 43 |
|
47 |
/** {@inheritDoc} */ |
|
48 | 44 |
@Override |
49 | 45 |
public SDDImportConfigurator getConfigurator() { |
50 | 46 |
return configurator; |
... | ... | |
62 | 58 |
super.addPages(); |
63 | 59 |
} |
64 | 60 |
|
65 |
/** {@inheritDoc} */ |
|
66 | 61 |
@Override |
67 | 62 |
public boolean performFinish() { |
68 | 63 |
URI source = dataSourcePage.getUri(); |
... | ... | |
74 | 69 |
return true; |
75 | 70 |
} |
76 | 71 |
|
77 |
/** {@inheritDoc} */ |
|
78 | 72 |
@Override |
79 | 73 |
public void init() { |
80 | 74 |
configurator = CdmStore.getImportManager().SddConfigurator(); |
81 | 75 |
} |
82 |
} |
|
76 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbcdImportConfiguratorWizardPage.java | ||
---|---|---|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
9 |
|
|
10 | 9 |
package eu.etaxonomy.taxeditor.io.wizard; |
11 | 10 |
|
12 | 11 |
import java.net.URI; |
... | ... | |
46 | 45 |
import eu.etaxonomy.taxeditor.ui.dialog.selection.SelectionDialogFactory; |
47 | 46 |
|
48 | 47 |
/** |
49 |
* |
|
50 | 48 |
* @author pplitzner |
51 |
* |
|
52 | 49 |
*/ |
53 | 50 |
public class AbcdImportConfiguratorWizardPage extends AbstractPreferenceWizard implements SelectionListener { |
54 | 51 |
|
... | ... | |
105 | 102 |
"Tooltips will explain parameters in more detail", configurator, true, false); |
106 | 103 |
} |
107 | 104 |
|
108 |
|
|
109 |
|
|
110 |
/** {@inheritDoc} */ |
|
111 | 105 |
@Override |
112 | 106 |
public void createControl(Composite parent) { |
113 | 107 |
Composite composite = new Composite(parent, SWT.NULL); |
... | ... | |
169 | 163 |
} |
170 | 164 |
}); |
171 | 165 |
|
172 |
|
|
173 |
|
|
174 | 166 |
Button checkBoxMoveToDefaultClassification = new Button(composite, SWT.CHECK); |
175 | 167 |
gridData = new GridData(); |
176 | 168 |
gridData.horizontalAlignment = GridData.FILL_HORIZONTAL; |
... | ... | |
537 | 529 |
abcdImportConfigurator.setDnaSoure(null); |
538 | 530 |
} |
539 | 531 |
} |
540 |
|
|
541 |
|
|
542 | 532 |
} |
543 | 533 |
|
544 |
public void saveConfigToPrefernceStore() {
|
|
534 |
public void saveConfigToPrefernceStore() { |
|
545 | 535 |
try{ |
546 | 536 |
abcdImportConfigurator.setDnaSoure(URI.create(textDNAProviderString.getText())); |
547 | 537 |
}catch(IllegalArgumentException e){ |
... | ... | |
549 | 539 |
abcdImportConfigurator.setDnaSoure(null); |
550 | 540 |
} |
551 | 541 |
|
552 |
|
|
553 | 542 |
PreferencesUtil.setStringValue(IPreferenceKeys.LAST_USED_ABCD_CONFIG, abcdImportConfigurator.toString()); |
554 |
|
|
555 |
|
|
556 | 543 |
} |
557 | 544 |
|
558 | 545 |
public String createConfigString(){ |
... | ... | |
560 | 547 |
|
561 | 548 |
} |
562 | 549 |
|
563 |
|
|
564 |
|
|
565 |
/* (non-Javadoc) |
|
566 |
* @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent) |
|
567 |
*/ |
|
568 | 550 |
@Override |
569 | 551 |
public void widgetDefaultSelected(SelectionEvent e) { |
570 | 552 |
// TODO Auto-generated method stub |
571 |
|
|
572 | 553 |
} |
573 | 554 |
|
574 | 555 |
public void createAbcdImportConfig() { |
575 | 556 |
this.abcdImportConfigurator = PreferencesUtil.getLocalAbcdImportConfigurator(false); |
576 |
|
|
577 | 557 |
} |
578 | 558 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ExcelNormalExplicitTaxaImportWizard.java | ||
---|---|---|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
9 |
|
|
10 | 9 |
package eu.etaxonomy.taxeditor.io.wizard; |
11 | 10 |
|
12 | 11 |
import java.io.File; |
... | ... | |
28 | 27 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
29 | 28 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
30 | 29 |
|
31 |
|
|
32 | 30 |
/** |
33 | 31 |
* <p>ExcelNormalExplicitTaxaImportWizard class.</p> |
34 | 32 |
* |
35 | 33 |
* @author n.hoffmann |
36 | 34 |
* @created Sep 22, 2009 |
37 |
* @version 1.0 |
|
38 | 35 |
*/ |
39 | 36 |
public class ExcelNormalExplicitTaxaImportWizard extends AbstractImportWizard<NormalExplicitImportConfigurator>{ |
40 | 37 |
|
... | ... | |
43 | 40 |
private ImportFromFileDataSourceWizardPage dataSourcePage; |
44 | 41 |
private static final Logger logger = Logger.getLogger(ExcelNormalExplicitTaxaImportWizard.class); |
45 | 42 |
|
46 |
/* (non-Javadoc) |
|
47 |
* @see eu.etaxonomy.taxeditor.io.wizard.AbstractImportWizard#getConfigurator() |
|
48 |
*/ |
|
49 |
/** {@inheritDoc} */ |
|
50 | 43 |
@Override |
51 | 44 |
public NormalExplicitImportConfigurator getConfigurator() { |
52 | 45 |
return configurator; |
53 | 46 |
} |
54 | 47 |
|
55 |
/* (non-Javadoc) |
|
56 |
* @see org.eclipse.jface.wizard.Wizard#performFinish() |
|
57 |
*/ |
|
58 |
/** {@inheritDoc} */ |
|
59 | 48 |
@Override |
60 | 49 |
public boolean performFinish() { |
61 | 50 |
URI source = dataSourcePage.getUri(); |
... | ... | |
82 | 71 |
return true; |
83 | 72 |
} |
84 | 73 |
|
85 |
/* (non-Javadoc) |
|
86 |
* @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection) |
|
87 |
*/ |
|
88 |
/** {@inheritDoc} */ |
|
89 | 74 |
@Override |
90 | 75 |
public void init(IWorkbench workbench, IStructuredSelection selection) { |
91 | 76 |
super.init(workbench, selection); |
... | ... | |
97 | 82 |
} |
98 | 83 |
} |
99 | 84 |
|
100 |
/* (non-Javadoc) |
|
101 |
* @see eu.etaxonomy.taxeditor.io.wizard.AbstractImportWizard#addPages() |
|
102 |
*/ |
|
103 |
/** {@inheritDoc} */ |
|
104 | 85 |
@Override |
105 | 86 |
public void addPages() { |
106 | 87 |
super.addPages(); |
... | ... | |
109 | 90 |
"Please choose an xls file in the NormalExplicit format.", new String[]{"*.xlsx", "*.xls", "*.*"}); |
110 | 91 |
addPage(dataSourcePage); |
111 | 92 |
} |
112 |
} |
|
93 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/SddImportWizard.java | ||
---|---|---|
26 | 26 |
* |
27 | 27 |
* @author n.hoffmann |
28 | 28 |
* @created Jun 16, 2010 |
29 |
* @version 1.0 |
|
30 | 29 |
*/ |
31 | 30 |
public class SddImportWizard extends AbstractImportWizard<SDDImportConfigurator> { |
32 | 31 |
|
... | ... | |
34 | 33 |
|
35 | 34 |
private ImportFromFileDataSourceWizardPage dataSourcePage; |
36 | 35 |
|
37 |
/* (non-Javadoc) |
|
38 |
* @see eu.etaxonomy.taxeditor.io.wizard.AbstractImportWizard#getConfigurator() |
|
39 |
*/ |
|
40 |
/** {@inheritDoc} */ |
|
41 | 36 |
@Override |
42 | 37 |
public SDDImportConfigurator getConfigurator() { |
43 | 38 |
return configurator; |
44 | 39 |
} |
45 | 40 |
|
46 |
/* |
|
47 |
* (non-Javadoc) |
|
48 |
* @see org.eclipse.jface.wizard.Wizard#addPage(org.eclipse.jface.wizard.IWizardPage) |
|
49 |
*/ |
|
50 |
/** {@inheritDoc} */ |
|
51 | 41 |
@Override |
52 | 42 |
public void addPages() { |
53 | 43 |
super.addPages(); |
... | ... | |
57 | 47 |
addPage(dataSourcePage); |
58 | 48 |
} |
59 | 49 |
|
60 |
/* (non-Javadoc) |
|
61 |
* @see org.eclipse.jface.wizard.Wizard#performFinish() |
|
62 |
*/ |
|
63 |
/** {@inheritDoc} */ |
|
64 | 50 |
@Override |
65 | 51 |
public boolean performFinish() { |
66 | 52 |
URI source = dataSourcePage.getUri(); |
... | ... | |
72 | 58 |
return true; |
73 | 59 |
} |
74 | 60 |
|
75 |
/* (non-Javadoc) |
|
76 |
* @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection) |
|
77 |
*/ |
|
78 |
/** {@inheritDoc} */ |
|
79 | 61 |
@Override |
80 | 62 |
public void init(IWorkbench workbench, IStructuredSelection selection) { |
81 | 63 |
super.init(workbench, selection); |
82 | 64 |
configurator = CdmStore.getImportManager().SddConfigurator(); |
83 | 65 |
} |
84 |
} |
|
66 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/ImageElement.java | ||
---|---|---|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
9 |
|
|
10 | 9 |
package eu.etaxonomy.taxeditor.ui.element; |
11 | 10 |
|
12 | 11 |
import java.io.IOException; |
... | ... | |
44 | 43 |
/** |
45 | 44 |
* @author n.hoffmann |
46 | 45 |
* @created Sep 24, 2010 |
47 |
* @version 1.0 |
|
48 | 46 |
*/ |
49 | 47 |
public class ImageElement extends AbstractCdmFormElement implements PaintListener{ |
50 | 48 |
|
51 | 49 |
/** |
52 | 50 |
* @author pplitzner |
53 | 51 |
* @since Jul 17, 2019 |
54 |
* |
|
55 | 52 |
*/ |
56 | 53 |
public class LoadImageJob extends Job { |
57 | 54 |
public LoadImageJob(String name) { |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/openurl/OpenUrlSelectorWizard.java | ||
---|---|---|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
9 |
|
|
10 | 9 |
package eu.etaxonomy.taxeditor.ui.openurl; |
11 | 10 |
|
12 | 11 |
import java.net.URI; |
... | ... | |
27 | 26 |
/** |
28 | 27 |
* @author n.hoffmann |
29 | 28 |
* @created Jan 31, 2011 |
30 |
* @version 1.0 |
|
31 | 29 |
*/ |
32 | 30 |
public class OpenUrlSelectorWizard extends Wizard { |
33 | 31 |
|
... | ... | |
45 | 43 |
|
46 | 44 |
private final String referenceDetail; |
47 | 45 |
|
48 |
|
|
49 |
|
|
50 | 46 |
/** |
51 | 47 |
* @param openUrlSelectorElement |
52 | 48 |
* @param reference |
... | ... | |
89 | 85 |
query.startPage = referenceDetail; |
90 | 86 |
} |
91 | 87 |
|
92 |
/* (non-Javadoc) |
|
93 |
* @see org.eclipse.jface.wizard.Wizard#addPages() |
|
94 |
*/ |
|
95 | 88 |
@Override |
96 | 89 |
public void addPages() { |
97 | 90 |
|
... | ... | |
101 | 94 |
super.addPages(); |
102 | 95 |
} |
103 | 96 |
|
104 |
/* (non-Javadoc) |
|
105 |
* @see org.eclipse.jface.wizard.Wizard#performFinish() |
|
106 |
*/ |
|
107 | 97 |
@Override |
108 | 98 |
public boolean performFinish() { |
109 | 99 |
return true; |
110 | 100 |
} |
111 | 101 |
|
112 |
/** |
|
113 |
* @param openUrlReference the openUrlReference to set |
|
114 |
*/ |
|
115 | 102 |
public void setOpenUrlReference(OpenUrlReference openUrlReference) { |
116 | 103 |
this.openUrlReference = openUrlReference; |
117 | 104 |
this.openUrlReferenceImageUri = openUrlReference.getJpegImage(PreferencesUtil.getIntValue(PreferencePredicate.MobotOpenUrlServiceMaxWidth.getKey(), true) |
118 | 105 |
, PreferencesUtil.getIntValue(PreferencePredicate.MobotOpenUrlServiceMaxHeight.getKey(), true)); |
119 | 106 |
} |
120 |
|
|
121 |
/** |
|
122 |
* @return the openUrlReference |
|
123 |
*/ |
|
124 | 107 |
public OpenUrlReference getOpenUrlReference() { |
125 | 108 |
return openUrlReference; |
126 | 109 |
} |
127 | 110 |
|
128 |
/** |
|
129 |
* @return |
|
130 |
*/ |
|
131 | 111 |
public List<OpenUrlReference> getResult() { |
132 | 112 |
return openUrlServiceWrapper.doResolve(query); |
133 | 113 |
} |
134 | 114 |
|
135 |
/** |
|
136 |
* @return the formFactory |
|
137 |
*/ |
|
138 | 115 |
public CdmFormFactory getFormFactory() { |
139 | 116 |
return formFactory; |
140 | 117 |
} |
141 | 118 |
|
142 |
/** |
|
143 |
* @return the openUrlServiceWrapper |
|
144 |
*/ |
|
145 | 119 |
public MobotOpenUrlServiceWrapper getOpenUrlServiceWrapper() { |
146 | 120 |
return openUrlServiceWrapper; |
147 | 121 |
} |
148 | 122 |
|
149 |
/** |
|
150 |
* @return |
|
151 |
*/ |
|
152 | 123 |
public URI getOpenUrlReferenceImageUri() { |
153 | 124 |
return openUrlReferenceImageUri; |
154 | 125 |
} |
... | ... | |
160 | 131 |
public String getReferenceDetail() { |
161 | 132 |
return referenceDetail; |
162 | 133 |
} |
163 |
} |
|
134 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/e4/SaveImportedSpecimenActionE4.java | ||
---|---|---|
31 | 31 |
import eu.etaxonomy.taxeditor.view.dataimport.GbifResponseComparator; |
32 | 32 |
|
33 | 33 |
/** |
34 |
* |
|
35 | 34 |
* @author pplitzner |
36 | 35 |
* @since Oct 4, 2017 |
37 |
* |
|
38 | 36 |
*/ |
39 | 37 |
public class SaveImportedSpecimenActionE4 extends Action { |
40 | 38 |
|
... | ... | |
50 | 48 |
@Override |
51 | 49 |
public void run() { |
52 | 50 |
Table table = dataImportView.getTable(); |
53 |
Collection<GbifResponse> checkedResults = new HashSet<GbifResponse>();
|
|
54 |
Collection<BioCaseResponse> checkedAbcdResults = new HashSet<BioCaseResponse>();
|
|
51 |
Collection<GbifResponse> checkedResults = new HashSet<>(); |
|
52 |
Collection<BioCaseResponse> checkedAbcdResults = new HashSet<>(); |
|
55 | 53 |
Object data; |
56 |
Set<String[]> unitIdsGbif = new HashSet<String[]>();
|
|
57 |
Set<String[]> unitIdsBioCase = new HashSet<String[]>();
|
|
58 |
List<GbifResponse> biocaseResponses = new ArrayList<GbifResponse>();
|
|
54 |
Set<String[]> unitIdsGbif = new HashSet<>(); |
|
55 |
Set<String[]> unitIdsBioCase = new HashSet<>(); |
|
56 |
List<GbifResponse> biocaseResponses = new ArrayList<>(); |
|
59 | 57 |
|
60 | 58 |
for(TableItem item:table.getItems()){ |
61 | 59 |
if(item.getChecked()){ |
... | ... | |
80 | 78 |
}else{ |
81 | 79 |
unitIdsGbif.add(tripleId); |
82 | 80 |
} |
83 |
|
|
84 |
|
|
85 | 81 |
} |
86 | 82 |
} |
87 | 83 |
Collections.sort(biocaseResponses, getComparator()); |
88 | 84 |
|
89 | 85 |
Abcd206ImportConfigurator configuratorAbcd; |
90 |
List<Abcd206ImportConfigurator> abcdConfigurators = new ArrayList<Abcd206ImportConfigurator>();
|
|
86 |
List<Abcd206ImportConfigurator> abcdConfigurators = new ArrayList<>(); |
|
91 | 87 |
DataSetResponse dataSetResponse; |
92 | 88 |
OccurenceQuery bioCaseOccurrenceQuery = null; |
93 | 89 |
URI dataSetUri = null; |
... | ... | |
118 | 114 |
configuratorAbcd.setSourceReferenceTitle(sourceRef); |
119 | 115 |
} |
120 | 116 |
|
121 |
unitIdsBioCase = new HashSet<String[]>();
|
|
117 |
unitIdsBioCase = new HashSet<>(); |
|
122 | 118 |
bioCaseOccurrenceQuery = new OccurenceQuery(unitIdsBioCase); |
123 | 119 |
configuratorAbcd.setOccurenceQuery(bioCaseOccurrenceQuery); |
124 | 120 |
|
... | ... | |
202 | 198 |
Job gbifJob = CdmStore.getImportManager().createIOServiceJob(configurator); |
203 | 199 |
CdmStore.getImportManager().run(gbifJob); |
204 | 200 |
} |
205 |
|
|
206 | 201 |
} |
207 | 202 |
|
208 | 203 |
private void persistTerm(DefinedTermBase<?> term, ITermService termService, ConversationHolder conversation){ |
... | ... | |
225 | 220 |
} |
226 | 221 |
return comparator; |
227 | 222 |
} |
228 |
|
|
229 |
} |
|
223 |
} |
Also available in: Unified diff
cleanup