Revision 94a85ef9
Added by Katja Luther over 6 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabaseRepairWizard.java | ||
---|---|---|
15 | 15 |
import eu.etaxonomy.cdm.io.operation.config.CacheUpdaterConfigurator; |
16 | 16 |
import eu.etaxonomy.cdm.io.common.IImportConfigurator.CHECK; |
17 | 17 |
import eu.etaxonomy.cdm.io.operation.config.SortIndexUpdaterConfigurator; |
18 |
import eu.etaxonomy.cdm.model.agent.AgentBase; |
|
19 |
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase; |
|
20 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
21 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; |
|
22 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
23 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
|
18 | 24 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
19 | 25 |
|
20 | 26 |
/** |
... | ... | |
58 | 64 |
Job updateJob = CdmStore.getImportManager().createIOServiceJob(config); |
59 | 65 |
CdmStore.getImportManager().run(updateJob); |
60 | 66 |
} |
67 |
if (test.updateAgentBase){ |
|
68 |
cacheUpdaterConfig.getClassList().add(TeamOrPersonBase.class); |
|
69 |
} |
|
70 |
if (test.updateReference){ |
|
71 |
cacheUpdaterConfig.getClassList().add(Reference.class); |
|
72 |
} |
|
73 |
if (test.updateName){ |
|
74 |
cacheUpdaterConfig.getClassList().add(TaxonName.class); |
|
75 |
} |
|
76 |
if (test.updateTaxonBase){ |
|
77 |
cacheUpdaterConfig.getClassList().add(TaxonBase.class); |
|
78 |
} |
|
79 |
if (test.updateSpecimen){ |
|
80 |
cacheUpdaterConfig.getClassList().add(SpecimenOrObservationBase.class); |
|
81 |
} |
|
61 | 82 |
if (!cacheUpdaterConfig.getClassList().isEmpty()){ |
62 | 83 |
cacheUpdaterConfig.setCheck(CHECK.IMPORT_WITHOUT_CHECK); |
63 | 84 |
Job updateJob2 = CdmStore.getImportManager().createIOServiceJob(cacheUpdaterConfig); |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/Test.java | ||
---|---|---|
15 | 15 |
import org.eclipse.swt.events.SelectionAdapter; |
16 | 16 |
import org.eclipse.swt.events.SelectionEvent; |
17 | 17 |
import org.eclipse.swt.layout.FillLayout; |
18 |
import org.eclipse.swt.layout.GridData; |
|
18 | 19 |
import org.eclipse.swt.layout.GridLayout; |
19 | 20 |
import org.eclipse.swt.widgets.Button; |
20 | 21 |
import org.eclipse.swt.widgets.Composite; |
... | ... | |
40 | 41 |
|
41 | 42 |
CacheUpdaterConfigurator config; |
42 | 43 |
SortIndexUpdaterConfigurator sortIndexConfig; |
44 |
boolean updateAgentBase = false; |
|
45 |
boolean updateReference = false; |
|
46 |
boolean updateTaxonBase = false; |
|
47 |
boolean updateName = false; |
|
48 |
boolean updateSpecimen = false; |
|
49 |
|
|
43 | 50 |
public Test(String pageName, CacheUpdaterConfigurator configTitleCache, SortIndexUpdaterConfigurator sortIndexConfig) { |
44 | 51 |
super(pageName); |
45 | 52 |
config = configTitleCache; |
... | ... | |
66 | 73 |
tbtmSortIndex.setControl(composite); |
67 | 74 |
composite.setLayout(new GridLayout(1, true)); |
68 | 75 |
|
76 |
|
|
69 | 77 |
Button checkBoxTaxonNode = new Button(composite, SWT.CHECK); |
70 | 78 |
checkBoxTaxonNode.setSelection(sortIndexConfig.isDoTaxonNode()); |
71 | 79 |
checkBoxTaxonNode.setText(Messages.DatabaseRepairPage_updateTaxonNodes); |
... | ... | |
109 | 117 |
Composite composite_1 = new Composite(tabFolder, SWT.NONE); |
110 | 118 |
tbtmNewItem.setControl(composite_1); |
111 | 119 |
composite_1.setLayout(new GridLayout(1, false)); |
112 |
|
|
120 |
|
|
121 |
Button checkBoxTeamOrPerson = new Button(composite_1, SWT.CHECK); |
|
122 |
checkBoxTeamOrPerson.setSelection(config.getClassList().contains(TeamOrPersonBase.class)); |
|
123 |
checkBoxTeamOrPerson.setText(Messages.DatabaseRepairPage_TeamOrPerson); |
|
124 |
checkBoxTeamOrPerson |
|
125 |
.setToolTipText(Messages.DatabaseRepairPage_toolTip_teamOrPerson); |
|
126 |
checkBoxTeamOrPerson.addSelectionListener(new SelectionAdapter() { |
|
127 |
@Override |
|
128 |
public void widgetSelected(SelectionEvent e) { |
|
129 |
Button b = (Button) e.widget; |
|
130 |
updateAgentBase = b.getSelection(); |
|
131 |
|
|
132 |
} |
|
133 |
}); |
|
134 |
|
|
135 |
Button checkBoxReference = new Button(composite_1, SWT.CHECK); |
|
136 |
checkBoxReference.setSelection(config.getClassList().contains(Reference.class)); |
|
137 |
checkBoxReference.setText(Messages.DatabaseRepairPage_Reference); |
|
138 |
checkBoxReference |
|
139 |
.setToolTipText(Messages.DatabaseRepairPage_toolTip_reference); |
|
140 |
checkBoxReference.addSelectionListener(new SelectionAdapter() { |
|
141 |
@Override |
|
142 |
public void widgetSelected(SelectionEvent e) { |
|
143 |
Button b = (Button) e.widget; |
|
144 |
updateReference= b.getSelection(); |
|
145 |
} |
|
146 |
}); |
|
147 |
|
|
113 | 148 |
Button checkBoxTaxonName = new Button(composite_1, SWT.CHECK); |
114 | 149 |
checkBoxTaxonName.setSelection(config.getClassList().contains(TaxonName.class)); |
115 | 150 |
checkBoxTaxonName.setText(Messages.DatabaseRepairPage_updateTaxonName); |
... | ... | |
118 | 153 |
checkBoxTaxonName.addSelectionListener(new SelectionAdapter() { |
119 | 154 |
@Override |
120 | 155 |
public void widgetSelected(SelectionEvent e) { |
121 |
List<Class<? extends IdentifiableEntity>> classList = config.getClassList(); |
|
122 |
classList.add(TaxonName.class); |
|
156 |
Button b = (Button) e.widget; |
|
157 |
updateName = b.getSelection(); |
|
158 |
|
|
123 | 159 |
} |
124 | 160 |
}); |
125 | 161 |
|
... | ... | |
131 | 167 |
checkBoxTaxonBase.addSelectionListener(new SelectionAdapter() { |
132 | 168 |
@Override |
133 | 169 |
public void widgetSelected(SelectionEvent e) { |
134 |
List<Class<? extends IdentifiableEntity>> classList = config.getClassList(); |
|
135 |
classList.add(TaxonBase.class); |
|
170 |
Button b = (Button) e.widget; |
|
171 |
updateTaxonBase = b.getSelection(); |
|
172 |
|
|
136 | 173 |
} |
137 | 174 |
}); |
138 | 175 |
|
139 |
Button checkBoxReference = new Button(composite_1, SWT.CHECK); |
|
140 |
checkBoxReference.setSelection(config.getClassList().contains(Reference.class)); |
|
141 |
checkBoxReference.setText(Messages.DatabaseRepairPage_Reference); |
|
142 |
checkBoxReference |
|
143 |
.setToolTipText(Messages.DatabaseRepairPage_toolTip_reference); |
|
144 |
checkBoxReference.addSelectionListener(new SelectionAdapter() { |
|
145 |
@Override |
|
146 |
public void widgetSelected(SelectionEvent e) { |
|
147 |
List<Class<? extends IdentifiableEntity>> classList = config.getClassList(); |
|
148 |
classList.add(Reference.class); |
|
149 |
} |
|
150 |
}); |
|
151 |
|
|
176 |
|
|
152 | 177 |
Button checkBoxSpecimen = new Button(composite_1, SWT.CHECK); |
153 | 178 |
checkBoxSpecimen.setSelection(config.getClassList().contains(SpecimenOrObservationBase.class)); |
154 | 179 |
checkBoxSpecimen.setText(Messages.DatabaseRepairPage_Specimen); |
... | ... | |
157 | 182 |
checkBoxSpecimen.addSelectionListener(new SelectionAdapter() { |
158 | 183 |
@Override |
159 | 184 |
public void widgetSelected(SelectionEvent e) { |
160 |
List<Class<? extends IdentifiableEntity>> classList = config.getClassList(); |
|
161 |
classList.add(SpecimenOrObservationBase.class); |
|
162 |
} |
|
163 |
}); |
|
164 |
|
|
165 |
Button checkBoxTeamOrPerson = new Button(composite_1, SWT.CHECK); |
|
166 |
checkBoxTeamOrPerson.setSelection(config.getClassList().contains(TeamOrPersonBase.class)); |
|
167 |
checkBoxTeamOrPerson.setText(Messages.DatabaseRepairPage_TeamOrPerson); |
|
168 |
checkBoxTeamOrPerson |
|
169 |
.setToolTipText(Messages.DatabaseRepairPage_toolTip_teamOrPerson); |
|
170 |
checkBoxTeamOrPerson.addSelectionListener(new SelectionAdapter() { |
|
171 |
@Override |
|
172 |
public void widgetSelected(SelectionEvent e) { |
|
173 |
List<Class<? extends IdentifiableEntity>> classList = config.getClassList(); |
|
174 |
classList.add(TeamOrPersonBase.class); |
|
185 |
Button b = (Button) e.widget; |
|
186 |
updateSpecimen = b.getSelection(); |
|
187 |
|
|
175 | 188 |
} |
176 | 189 |
}); |
177 |
|
|
178 |
|
|
190 |
|
|
179 | 191 |
tabFolder.pack(); |
180 | 192 |
} |
181 | 193 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/Messages.java | ||
---|---|---|
215 | 215 |
public static String DatabasePreferencesPage_Define_Default_NomenclaturalCode; |
216 | 216 |
public static String DatabasePreferencesPage_UseLocalPreferences; |
217 | 217 |
public static String DatabasePreferencesPage_Specimen_Or_Observation; |
218 |
public static String DatabasePreferencesPage_SetPublishFlag; |
|
218 | 219 |
|
219 | 220 |
public static String ImportFromFileAndChooseVocIdWizardPage_AreaVoc; |
220 | 221 |
|
... | ... | |
244 | 245 |
|
245 | 246 |
|
246 | 247 |
|
248 |
|
|
249 |
|
|
250 |
|
|
247 | 251 |
|
248 | 252 |
|
249 | 253 |
static { |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages.properties | ||
---|---|---|
30 | 30 |
DatabaseRepairPage_toolTip_reference=Caches of all references are recalculated. |
31 | 31 |
DatabaseRepairPage_Specimen=Specimen |
32 | 32 |
DatabaseRepairPage_toolTip_specimen=Caches of all Derived Units und Field Units are recalculated. |
33 |
DatabaseRepairPage_TeamOrPerson=Teams and Persons
|
|
34 |
DatabaseRepairPage_toolTip_teamOrPerson=Caches of all Teams und Persons are recalculated.
|
|
33 |
DatabaseRepairPage_TeamOrPerson=Persons and Teams
|
|
34 |
DatabaseRepairPage_toolTip_teamOrPerson=Caches of all Persons and Teams are recalculated.
|
|
35 | 35 |
|
36 | 36 |
UriWithLabelElement_URL_NOT_SAVED=URI won't be saved\! |
37 | 37 |
UriWithLabelElement_COULD_NOT_OPEN_BROWSER=Could not open external browser. URI is invalid. |
... | ... | |
190 | 190 |
DatabasePreferencesPage_UseLocalPreferences=Allow to use local preference |
191 | 191 |
DatabasePreferencesPage_Specimen_Or_Observation=Specimen or observation configuration |
192 | 192 |
DatabasePreferncesPage_Life_Form=Show Life-Form in details view of field units |
193 |
DatabasePreferencesPage_SetPublishFlag=Configure the handling of publish flag for new taxa |
|
193 | 194 |
|
194 | 195 |
ImportFromFileAndChooseVocIdWizardPage_AreaVoc=Area Vocabulary |
195 | 196 |
ImportFromFileAndChooseVocIdWizardOage_AreaVoc_toolTip=Please choose a vocabulary for the used areas. |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages_de.properties | ||
---|---|---|
30 | 30 |
DatabaseRepairPage_toolTip_reference=Die Caches aller Referenzen werden aktualisiert. |
31 | 31 |
DatabaseRepairPage_Specimen=Specimen |
32 | 32 |
DatabaseRepairPage_toolTip_specimen=Die Caches aller Derived Units und Field Units werden aktualisiert. |
33 |
DatabaseRepairPage_TeamOrPerson=Teams und Personen
|
|
34 |
DatabaseRepairPage_toolTip_teamOrPerson=Die Caches aller Teams und Personen werden aktualisiert.
|
|
33 |
DatabaseRepairPage_TeamOrPerson=Personen und Teams
|
|
34 |
DatabaseRepairPage_toolTip_teamOrPerson=Die Caches aller Personen und Teams werden aktualisiert.
|
|
35 | 35 |
|
36 | 36 |
UriWithLabelElement_URL_NOT_SAVED=URI wird nicht gespeichert\! |
37 | 37 |
UriWithLabelElement_COULD_NOT_OPEN_BROWSER=Externer Browser konnte nicht ge?ffnet werden. URI ist ung\u00FCtlig. |
... | ... | |
190 | 190 |
DatabasePreferencesPage_Define_Default_NomenclaturalCode=Festlegen des default Nomenklatorischen Codes |
191 | 191 |
DatabasePreferencesPage_UseLocalPreferences=Erlaube das lokale ?berschreiben |
192 | 192 |
DatabasePreferencesPage_Specimen_Or_Observation=Konfiguration von Specimen und Observationen |
193 |
DatabasePreferencesPage_SetPublishFlag=Konfiguriere das Handling des Publish Flags bei neuen Taxa |
|
193 | 194 |
|
194 | 195 |
ImportFromFileAndChooseVocIdWizardPage_AreaVoc=Area Vokabular |
195 | 196 |
ImportFromFileAndChooseVocIdWizardOage_AreaVoc_toolTip=Bitte w?hlen Sie ein Vokabular f?r die genutzten Areas aus. |
Also available in: Unified diff
order of cache updater class in wizard and configurator