Revision dc7b6f3a
Added by Niels Hoffmann almost 13 years ago
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/handler/GeneratePdfHandler.java | ||
---|---|---|
55 | 55 |
return null; |
56 | 56 |
} |
57 | 57 |
|
58 |
configurator = PublishConfigurator.NewLocalInstance(CdmStore.getCurrentApplicationController());
|
|
58 |
configurator = PublishConfigurator.NewLocalInstance(CdmStore.getCurrentApplicationConfiguration());
|
|
59 | 59 |
|
60 | 60 |
Element taxonNodeElement = getTaxonNodeElement((TaxonEditorInput) input); |
61 | 61 |
configurator.addSelectedTaxonNodeElements(taxonNodeElement); |
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/SelectServiceWizardPage.java | ||
---|---|---|
148 | 148 |
label_serviceUrl.setEnabled(false); |
149 | 149 |
text_serviceUrl.setEnabled(false); |
150 | 150 |
|
151 |
setConfigurator(PublishConfigurator.NewLocalInstance(CdmStore.getCurrentApplicationController()));
|
|
151 |
setConfigurator(PublishConfigurator.NewLocalInstance(CdmStore.getCurrentApplicationConfiguration()));
|
|
152 | 152 |
getConfigurator().addOutputModule(getOutputModule()); |
153 | 153 |
} |
154 | 154 |
|
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/AbstractIOManager.java | ||
---|---|---|
13 | 13 |
import org.eclipse.core.runtime.jobs.Job; |
14 | 14 |
import org.eclipse.ui.progress.IProgressConstants; |
15 | 15 |
|
16 |
import eu.etaxonomy.cdm.api.application.CdmApplicationController;
|
|
16 |
import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
|
|
17 | 17 |
import eu.etaxonomy.cdm.io.common.IIoConfigurator; |
18 | 18 |
|
19 | 19 |
/** |
... | ... | |
27 | 27 |
*/ |
28 | 28 |
public abstract class AbstractIOManager<CONFIGURATOR extends IIoConfigurator> { |
29 | 29 |
|
30 |
protected CdmApplicationController applicationController;
|
|
30 |
protected ICdmApplicationConfiguration applicationConfiguration;
|
|
31 | 31 |
|
32 | 32 |
public static enum TYPE { |
33 | 33 |
BerlinModel, Jaxb, Tcs, Excel_Taxa, Endnote, Sdd, Abcd |
... | ... | |
45 | 45 |
* @param <CONFIGURATOR> |
46 | 46 |
* a CONFIGURATOR object. |
47 | 47 |
*/ |
48 |
protected AbstractIOManager(CdmApplicationController applicationController) { |
|
49 |
this.applicationController = applicationController; |
|
48 |
protected AbstractIOManager( |
|
49 |
ICdmApplicationConfiguration applicationConfiguration) { |
|
50 |
this.applicationConfiguration = applicationConfiguration; |
|
50 | 51 |
} |
51 | 52 |
|
52 | 53 |
/** |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ExportManager.java | ||
---|---|---|
17 | 17 |
import org.eclipse.core.runtime.jobs.Job; |
18 | 18 |
import org.eclipse.swt.widgets.Display; |
19 | 19 |
|
20 |
import eu.etaxonomy.cdm.api.application.CdmApplicationController;
|
|
20 |
import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
|
|
21 | 21 |
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled; |
22 | 22 |
import eu.etaxonomy.cdm.io.common.CdmDefaultExport; |
23 | 23 |
import eu.etaxonomy.cdm.io.common.IExportConfigurator; |
... | ... | |
40 | 40 |
|
41 | 41 |
/** |
42 | 42 |
* |
43 |
* @param applicationController
|
|
43 |
* @param applicationConfiguration
|
|
44 | 44 |
*/ |
45 |
private ExportManager(CdmApplicationController applicationController) {
|
|
46 |
super(applicationController);
|
|
45 |
private ExportManager(ICdmApplicationConfiguration applicationConfiguration) {
|
|
46 |
super(applicationConfiguration);
|
|
47 | 47 |
} |
48 | 48 |
|
49 | 49 |
/** |
... | ... | |
51 | 51 |
* NewInstance |
52 | 52 |
* </p> |
53 | 53 |
* |
54 |
* @param applicationController
|
|
54 |
* @param applicationConfiguration
|
|
55 | 55 |
* a |
56 | 56 |
* {@link eu.etaxonomy.cdm.api.application.CdmApplicationController} |
57 | 57 |
* object. |
58 | 58 |
* @return a {@link eu.etaxonomy.taxeditor.io.ExportManager} object. |
59 | 59 |
*/ |
60 | 60 |
public static ExportManager NewInstance( |
61 |
CdmApplicationController applicationController) {
|
|
62 |
return new ExportManager(applicationController);
|
|
61 |
ICdmApplicationConfiguration applicationConfiguration) {
|
|
62 |
return new ExportManager(applicationConfiguration);
|
|
63 | 63 |
} |
64 | 64 |
|
65 | 65 |
/** |
... | ... | |
102 | 102 |
CdmDefaultExport<IExportConfigurator> exporter = new CdmDefaultExport<IExportConfigurator>(); |
103 | 103 |
configurator.setProgressMonitor(CdmProgressMonitorAdapter |
104 | 104 |
.CreateSubMonitor(monitor, 80)); |
105 |
exporter.setCdmAppController(applicationController);
|
|
105 |
exporter.setCdmAppController(applicationConfiguration);
|
|
106 | 106 |
monitor.worked(10); |
107 | 107 |
|
108 | 108 |
try { |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ImportManager.java | ||
---|---|---|
1 | 1 |
// $Id$ |
2 | 2 |
/** |
3 |
* Copyright (C) 2007 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
9 |
*/ |
|
3 |
* Copyright (C) 2007 EDIT
|
|
4 |
* European Distributed Institute of Taxonomy
|
|
5 |
* http://www.e-taxonomy.eu
|
|
6 |
*
|
|
7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
|
8 |
* See LICENSE.TXT at the top of this package for the full license terms.
|
|
9 |
*/
|
|
10 | 10 |
|
11 | 11 |
package eu.etaxonomy.taxeditor.io; |
12 | 12 |
|
... | ... | |
17 | 17 |
import org.eclipse.core.runtime.jobs.Job; |
18 | 18 |
import org.eclipse.swt.widgets.Display; |
19 | 19 |
|
20 |
import eu.etaxonomy.cdm.api.application.CdmApplicationController;
|
|
20 |
import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
|
|
21 | 21 |
import eu.etaxonomy.cdm.io.berlinModel.in.BerlinModelImportConfigurator; |
22 | 22 |
import eu.etaxonomy.cdm.io.common.CdmDefaultImport; |
23 | 23 |
import eu.etaxonomy.cdm.io.common.IImportConfigurator; |
... | ... | |
32 | 32 |
import eu.etaxonomy.taxeditor.store.StoreUtil; |
33 | 33 |
|
34 | 34 |
/** |
35 |
* <p>ImportHandler class.</p> |
|
36 |
* |
|
35 |
* <p> |
|
36 |
* ImportHandler class. |
|
37 |
* </p> |
|
38 |
* |
|
37 | 39 |
* @author n.hoffmann |
38 | 40 |
* @created Sep 11, 2009 |
39 | 41 |
* @version 1.0 |
... | ... | |
41 | 43 |
public class ImportManager extends AbstractIOManager<IImportConfigurator> { |
42 | 44 |
|
43 | 45 |
/** |
44 |
* @param applicationController
|
|
46 |
* @param applicationConfiguration
|
|
45 | 47 |
*/ |
46 |
private ImportManager( |
|
47 |
CdmApplicationController applicationController) { |
|
48 |
super(applicationController); |
|
48 |
private ImportManager(ICdmApplicationConfiguration applicationConfiguration) { |
|
49 |
super(applicationConfiguration); |
|
49 | 50 |
} |
50 |
|
|
51 |
|
|
51 | 52 |
/** |
52 |
* <p>NewInstance</p> |
|
53 |
* |
|
54 |
* @param applicationController a {@link eu.etaxonomy.cdm.api.application.CdmApplicationController} object. |
|
53 |
* <p> |
|
54 |
* NewInstance |
|
55 |
* </p> |
|
56 |
* |
|
57 |
* @param applicationConfiguration |
|
58 |
* a |
|
59 |
* {@link eu.etaxonomy.cdm.api.application.CdmApplicationController} |
|
60 |
* object. |
|
55 | 61 |
* @return a {@link eu.etaxonomy.taxeditor.io.ImportManager} object. |
56 | 62 |
*/ |
57 |
public static ImportManager NewInstance(CdmApplicationController applicationController){ |
|
58 |
return new ImportManager(applicationController); |
|
63 |
public static ImportManager NewInstance( |
|
64 |
ICdmApplicationConfiguration applicationConfiguration) { |
|
65 |
return new ImportManager(applicationConfiguration); |
|
59 | 66 |
} |
60 |
|
|
67 |
|
|
61 | 68 |
/** |
62 | 69 |
* Use when importing data into the current application context |
63 |
* |
|
64 |
* @param configurator a {@link eu.etaxonomy.cdm.io.common.IImportConfigurator} object. |
|
70 |
* |
|
71 |
* @param configurator |
|
72 |
* a {@link eu.etaxonomy.cdm.io.common.IImportConfigurator} |
|
73 |
* object. |
|
65 | 74 |
* @return a {@link org.eclipse.core.runtime.jobs.Job} object. |
66 | 75 |
*/ |
67 |
protected Job createIOJob(final IImportConfigurator configurator){ |
|
76 |
@Override |
|
77 |
protected Job createIOJob(final IImportConfigurator configurator) { |
|
68 | 78 |
Assert.isNotNull(configurator, "Configuration may not be null"); |
69 |
|
|
79 |
|
|
70 | 80 |
final Display display = Display.getDefault(); |
71 |
|
|
72 |
Job job = new Job("Import: " + configurator.getClass().getSimpleName()){ |
|
73 |
|
|
81 |
|
|
82 |
Job job = new Job("Import: " + configurator.getClass().getSimpleName()) {
|
|
83 |
|
|
74 | 84 |
@Override |
75 | 85 |
protected IStatus run(IProgressMonitor monitor) { |
76 | 86 |
monitor.beginTask("Importing data", 100); |
77 |
configurator.setProgressMonitor(CdmProgressMonitorAdapter.CreateSubMonitor(monitor, 70)); |
|
78 |
|
|
87 |
configurator.setProgressMonitor(CdmProgressMonitorAdapter |
|
88 |
.CreateSubMonitor(monitor, 70)); |
|
89 |
|
|
79 | 90 |
monitor.worked(10); |
80 |
|
|
91 |
|
|
81 | 92 |
CdmDefaultImport<IImportConfigurator> importer = new CdmDefaultImport<IImportConfigurator>(); |
82 |
importer.setCdmAppController(applicationController);
|
|
83 |
monitor.worked(10);
|
|
84 |
|
|
85 |
try{ |
|
93 |
importer.setCdmAppController(applicationConfiguration);
|
|
94 |
monitor.worked(10); |
|
95 |
|
|
96 |
try {
|
|
86 | 97 |
importer.invoke(configurator); |
87 | 98 |
monitor.worked(60); |
88 |
}catch(RuntimeException e){ |
|
89 |
StoreUtil.errorDialog("Error importing data", this, "An error occured while" + |
|
90 |
"importing from source '" + configurator.getSourceNameString() + "'.\n" + |
|
91 |
"Please check error log for details.", e); |
|
99 |
} catch (RuntimeException e) { |
|
100 |
StoreUtil.errorDialog( |
|
101 |
"Error importing data", |
|
102 |
this, |
|
103 |
"An error occured while" |
|
104 |
+ "importing from source '" |
|
105 |
+ configurator.getSourceNameString() |
|
106 |
+ "'.\n" |
|
107 |
+ "Please check error log for details.", e); |
|
92 | 108 |
} |
93 |
|
|
109 |
|
|
94 | 110 |
monitor.worked(10); |
95 | 111 |
monitor.done(); |
96 |
|
|
112 |
|
|
97 | 113 |
display.asyncExec(new Runnable() { |
98 |
|
|
114 |
|
|
99 | 115 |
@Override |
100 | 116 |
public void run() { |
101 | 117 |
CdmStore.getContextManager().notifyContextRefresh(); |
102 | 118 |
} |
103 | 119 |
}); |
104 |
|
|
120 |
|
|
105 | 121 |
return Status.OK_STATUS; |
106 | 122 |
} |
107 | 123 |
}; |
108 |
|
|
124 |
|
|
109 | 125 |
return job; |
110 |
|
|
126 |
|
|
111 | 127 |
} |
112 | 128 |
|
113 |
private IImportConfigurator getConfigurator(TYPE type){ |
|
129 |
private IImportConfigurator getConfigurator(TYPE type) {
|
|
114 | 130 |
Assert.isNotNull(type, "Type should not be null"); |
115 |
|
|
116 |
switch(type){ |
|
117 |
case BerlinModel: |
|
118 |
return BerlinModelImportConfigurator.NewInstance(null, null); |
|
119 |
case Jaxb: |
|
120 |
return JaxbImportConfigurator.NewInstance(null, null); |
|
121 |
case Tcs: |
|
122 |
return TcsXmlImportConfigurator.NewInstance(null, null); |
|
123 |
case Endnote: |
|
124 |
return EndnoteImportConfigurator.NewInstance(null, null); |
|
125 |
case Excel_Taxa: |
|
126 |
return NormalExplicitImportConfigurator.NewInstance(null, null, null); |
|
127 |
case Abcd: |
|
128 |
return Abcd206ImportConfigurator.NewInstance(null, null); |
|
129 |
case Sdd: |
|
130 |
return SDDImportConfigurator.NewInstance(null, null); |
|
131 |
default: |
|
132 |
StoreUtil.notImplementedMessage(this); |
|
133 |
throw new IllegalArgumentException("Import not supported yet"); |
|
131 |
|
|
132 |
switch (type) { |
|
133 |
case BerlinModel: |
|
134 |
return BerlinModelImportConfigurator.NewInstance(null, null); |
|
135 |
case Jaxb: |
|
136 |
return JaxbImportConfigurator.NewInstance(null, null); |
|
137 |
case Tcs: |
|
138 |
return TcsXmlImportConfigurator.NewInstance(null, null); |
|
139 |
case Endnote: |
|
140 |
return EndnoteImportConfigurator.NewInstance(null, null); |
|
141 |
case Excel_Taxa: |
|
142 |
return NormalExplicitImportConfigurator.NewInstance(null, null, |
|
143 |
null); |
|
144 |
case Abcd: |
|
145 |
return Abcd206ImportConfigurator.NewInstance(null, null); |
|
146 |
case Sdd: |
|
147 |
return SDDImportConfigurator.NewInstance(null, null); |
|
148 |
default: |
|
149 |
StoreUtil.notImplementedMessage(this); |
|
150 |
throw new IllegalArgumentException("Import not supported yet"); |
|
134 | 151 |
} |
135 | 152 |
} |
136 |
|
|
153 |
|
|
137 | 154 |
/** |
138 |
* <p>BerlinModelConfigurator</p> |
|
139 |
* |
|
140 |
* @return a {@link eu.etaxonomy.cdm.io.berlinModel.in.BerlinModelImportConfigurator} object. |
|
155 |
* <p> |
|
156 |
* BerlinModelConfigurator |
|
157 |
* </p> |
|
158 |
* |
|
159 |
* @return a |
|
160 |
* {@link eu.etaxonomy.cdm.io.berlinModel.in.BerlinModelImportConfigurator} |
|
161 |
* object. |
|
141 | 162 |
*/ |
142 |
public final BerlinModelImportConfigurator BerlinModelConfigurator() { return (BerlinModelImportConfigurator) getConfigurator(TYPE.BerlinModel); } |
|
163 |
public final BerlinModelImportConfigurator BerlinModelConfigurator() { |
|
164 |
return (BerlinModelImportConfigurator) getConfigurator(TYPE.BerlinModel); |
|
165 |
} |
|
166 |
|
|
143 | 167 |
/** |
144 |
* <p>JaxbConfigurator</p> |
|
145 |
* |
|
168 |
* <p> |
|
169 |
* JaxbConfigurator |
|
170 |
* </p> |
|
171 |
* |
|
146 | 172 |
* @return a {@link eu.etaxonomy.cdm.io.jaxb.JaxbImportConfigurator} object. |
147 | 173 |
*/ |
148 |
public final JaxbImportConfigurator JaxbConfigurator() { return (JaxbImportConfigurator) getConfigurator(TYPE.Jaxb); } |
|
174 |
public final JaxbImportConfigurator JaxbConfigurator() { |
|
175 |
return (JaxbImportConfigurator) getConfigurator(TYPE.Jaxb); |
|
176 |
} |
|
177 |
|
|
149 | 178 |
/** |
150 |
* <p>TcsConfigurator</p> |
|
151 |
* |
|
152 |
* @return a {@link eu.etaxonomy.cdm.io.tcsxml.in.TcsXmlImportConfigurator} object. |
|
179 |
* <p> |
|
180 |
* TcsConfigurator |
|
181 |
* </p> |
|
182 |
* |
|
183 |
* @return a {@link eu.etaxonomy.cdm.io.tcsxml.in.TcsXmlImportConfigurator} |
|
184 |
* object. |
|
153 | 185 |
*/ |
154 |
public final TcsXmlImportConfigurator TcsConfigurator() { return (TcsXmlImportConfigurator) getConfigurator(TYPE.Tcs); } |
|
186 |
public final TcsXmlImportConfigurator TcsConfigurator() { |
|
187 |
return (TcsXmlImportConfigurator) getConfigurator(TYPE.Tcs); |
|
188 |
} |
|
189 |
|
|
155 | 190 |
/** |
156 |
* <p>EndnoteConfigurator</p> |
|
157 |
* |
|
158 |
* @return a {@link eu.etaxonomy.cdm.io.reference.endnote.in.EndnoteImportConfigurator} object. |
|
191 |
* <p> |
|
192 |
* EndnoteConfigurator |
|
193 |
* </p> |
|
194 |
* |
|
195 |
* @return a |
|
196 |
* {@link eu.etaxonomy.cdm.io.reference.endnote.in.EndnoteImportConfigurator} |
|
197 |
* object. |
|
159 | 198 |
*/ |
160 |
public final EndnoteImportConfigurator EndnoteConfigurator() { return (EndnoteImportConfigurator) getConfigurator(TYPE.Endnote); } |
|
199 |
public final EndnoteImportConfigurator EndnoteConfigurator() { |
|
200 |
return (EndnoteImportConfigurator) getConfigurator(TYPE.Endnote); |
|
201 |
} |
|
202 |
|
|
161 | 203 |
/** |
162 |
* <p>NormalExplicitConfigurator</p> |
|
163 |
* |
|
164 |
* @return a {@link eu.etaxonomy.cdm.io.excel.taxa.NormalExplicitImportConfigurator} object. |
|
204 |
* <p> |
|
205 |
* NormalExplicitConfigurator |
|
206 |
* </p> |
|
207 |
* |
|
208 |
* @return a |
|
209 |
* {@link eu.etaxonomy.cdm.io.excel.taxa.NormalExplicitImportConfigurator} |
|
210 |
* object. |
|
165 | 211 |
*/ |
166 |
public final NormalExplicitImportConfigurator NormalExplicitConfigurator() { return (NormalExplicitImportConfigurator) getConfigurator(TYPE.Excel_Taxa); } |
|
212 |
public final NormalExplicitImportConfigurator NormalExplicitConfigurator() { |
|
213 |
return (NormalExplicitImportConfigurator) getConfigurator(TYPE.Excel_Taxa); |
|
214 |
} |
|
215 |
|
|
167 | 216 |
/** |
168 |
* <p>SddConfigurator</p> |
|
169 |
* |
|
170 |
* @return a {@link eu.etaxonomy.cdm.io.sdd.in.SDDImportConfigurator} object. |
|
217 |
* <p> |
|
218 |
* SddConfigurator |
|
219 |
* </p> |
|
220 |
* |
|
221 |
* @return a {@link eu.etaxonomy.cdm.io.sdd.in.SDDImportConfigurator} |
|
222 |
* object. |
|
171 | 223 |
*/ |
172 |
public final SDDImportConfigurator SddConfigurator() { return (SDDImportConfigurator) getConfigurator(TYPE.Sdd); } |
|
224 |
public final SDDImportConfigurator SddConfigurator() { |
|
225 |
return (SDDImportConfigurator) getConfigurator(TYPE.Sdd); |
|
226 |
} |
|
227 |
|
|
173 | 228 |
/** |
174 |
* <p>AbcdConfigurator</p> |
|
175 |
* |
|
176 |
* @return a {@link eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator} object. |
|
229 |
* <p> |
|
230 |
* AbcdConfigurator |
|
231 |
* </p> |
|
232 |
* |
|
233 |
* @return a |
|
234 |
* {@link eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator} |
|
235 |
* object. |
|
177 | 236 |
*/ |
178 |
public final Abcd206ImportConfigurator AbcdConfigurator() { return (Abcd206ImportConfigurator) getConfigurator(TYPE.Abcd); } |
|
179 |
|
|
180 |
|
|
237 |
public final Abcd206ImportConfigurator AbcdConfigurator() { |
|
238 |
return (Abcd206ImportConfigurator) getConfigurator(TYPE.Abcd); |
|
239 |
} |
|
240 |
|
|
181 | 241 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/ExternalReferenceServiceWizardPage.java | ||
---|---|---|
130 | 130 |
@Override |
131 | 131 |
public void widgetSelected(SelectionEvent e) { |
132 | 132 |
String query = text_query.getText(); |
133 |
List<Reference> publications = ipniService.getPublications(query, null, (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationController(), null);
|
|
133 |
List<Reference> publications = ipniService.getPublications(query, null, (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationConfiguration(), null);
|
|
134 | 134 |
viewer.setInput(publications); |
135 | 135 |
} |
136 | 136 |
|
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStore.java | ||
---|---|---|
56 | 56 |
|
57 | 57 |
private static CdmStore instance; |
58 | 58 |
|
59 |
private final CdmApplicationController applicationController;
|
|
59 |
private final ICdmApplicationConfiguration applicationConfiguration;
|
|
60 | 60 |
|
61 | 61 |
private static LoginManager loginManager = new LoginManager(); |
62 | 62 |
|
... | ... | |
166 | 166 |
getContextManager().notifyContextAboutToStop(monitor); |
167 | 167 |
if ((monitor == null || (!monitor.isCanceled()) && isActive())) { |
168 | 168 |
getContextManager().notifyContextStop(monitor); |
169 |
if (instance.getApplicationController() != null) { |
|
170 |
instance.getApplicationController().close(); |
|
171 |
} |
|
172 | 169 |
instance.close(); |
173 | 170 |
} |
174 | 171 |
} |
... | ... | |
187 | 184 |
|
188 | 185 |
private CdmStore(CdmApplicationController applicationController, |
189 | 186 |
ICdmDataSource dataSource) { |
190 |
this.applicationController = applicationController;
|
|
187 |
this.applicationConfiguration = applicationController;
|
|
191 | 188 |
this.cdmDatasource = dataSource; |
192 | 189 |
isConnected = true; |
193 | 190 |
} |
... | ... | |
197 | 194 |
* |
198 | 195 |
* @return |
199 | 196 |
*/ |
200 |
private CdmApplicationController getApplicationController() {
|
|
197 |
private ICdmApplicationConfiguration getApplicationConfiguration() {
|
|
201 | 198 |
try { |
202 |
return applicationController;
|
|
199 |
return applicationConfiguration;
|
|
203 | 200 |
} catch (Exception e) { |
204 | 201 |
StoreUtil.error(CdmStore.class, e); |
205 | 202 |
} |
... | ... | |
215 | 212 |
* {@link eu.etaxonomy.cdm.api.application.CdmApplicationController} |
216 | 213 |
* object. |
217 | 214 |
*/ |
218 |
public static CdmApplicationController getCurrentApplicationController() {
|
|
215 |
public static ICdmApplicationConfiguration getCurrentApplicationConfiguration() {
|
|
219 | 216 |
if (getDefault() != null) { |
220 |
return getDefault().getApplicationController();
|
|
217 |
return getDefault().getApplicationConfiguration();
|
|
221 | 218 |
} |
222 | 219 |
return null; |
223 | 220 |
} |
... | ... | |
234 | 231 |
* object. |
235 | 232 |
*/ |
236 | 233 |
public static ConversationHolder createConversation() { |
237 |
ConversationHolder conversation = getCurrentApplicationController()
|
|
234 |
ConversationHolder conversation = getCurrentApplicationConfiguration()
|
|
238 | 235 |
.NewConversation(); |
239 | 236 |
|
240 | 237 |
conversation.startTransaction(); |
... | ... | |
250 | 247 |
* @return |
251 | 248 |
*/ |
252 | 249 |
public static <T extends IService> T getService(Class<T> serviceClass) { |
253 |
ICdmApplicationConfiguration configuration = getCurrentApplicationController();
|
|
250 |
ICdmApplicationConfiguration configuration = getCurrentApplicationConfiguration();
|
|
254 | 251 |
|
255 | 252 |
Method[] methods = ICdmApplicationConfiguration.class |
256 | 253 |
.getDeclaredMethods(); |
... | ... | |
287 | 284 |
* object. |
288 | 285 |
*/ |
289 | 286 |
public static ProviderManager getAuthenticationManager() { |
290 |
return getCurrentApplicationController().getAuthenticationManager();
|
|
287 |
return getCurrentApplicationConfiguration().getAuthenticationManager();
|
|
291 | 288 |
} |
292 | 289 |
|
293 | 290 |
/** |
... | ... | |
298 | 295 |
* @return a {@link eu.etaxonomy.cdm.ext.geo.IEditGeoService} object. |
299 | 296 |
*/ |
300 | 297 |
public static IEditGeoService getGeoService() { |
301 |
return (IEditGeoService) getCurrentApplicationController().getBean(
|
|
298 |
return (IEditGeoService) getCurrentApplicationConfiguration().getBean(
|
|
302 | 299 |
"editGeoService"); |
303 | 300 |
} |
304 | 301 |
|
... | ... | |
397 | 394 |
* @return a {@link eu.etaxonomy.taxeditor.io.ImportManager} object. |
398 | 395 |
*/ |
399 | 396 |
public static ImportManager getImportManager() { |
400 |
return ImportManager.NewInstance(getCurrentApplicationController());
|
|
397 |
return ImportManager.NewInstance(getCurrentApplicationConfiguration());
|
|
401 | 398 |
} |
402 | 399 |
|
403 | 400 |
/** |
... | ... | |
408 | 405 |
* @return a {@link eu.etaxonomy.taxeditor.io.ExportManager} object. |
409 | 406 |
*/ |
410 | 407 |
public static ExportManager getExportManager() { |
411 |
return ExportManager.NewInstance(getCurrentApplicationController());
|
|
408 |
return ExportManager.NewInstance(getCurrentApplicationConfiguration());
|
|
412 | 409 |
} |
413 | 410 |
|
414 | 411 |
/** |
Also available in: Unified diff
cdmlib classes that were programmed against CdmApplicationController now accept ICdmApplicationController. Adapted accordingly.