Revision 5cf75203
Added by Cherian Mathew almost 9 years ago
.gitattributes | ||
---|---|---|
4 | 4 |
src/main/java/eu/etaxonomy/cdm/vaadin/AppWidgetSet.gwt.xml -text |
5 | 5 |
src/main/java/eu/etaxonomy/cdm/vaadin/CdmAppInitializer.java.bkp -text |
6 | 6 |
src/main/java/eu/etaxonomy/cdm/vaadin/component/HorizontalToolbar.java -text |
7 |
src/main/java/eu/etaxonomy/cdm/vaadin/component/NewTaxonBaseComposite.java -text |
|
7 | 8 |
src/main/java/eu/etaxonomy/cdm/vaadin/component/StatusComposite.java -text |
8 | 9 |
src/main/java/eu/etaxonomy/cdm/vaadin/container/CdmSQLContainer.java -text |
9 | 10 |
src/main/java/eu/etaxonomy/cdm/vaadin/container/CdmSpringConnectionPool.java -text |
11 |
src/main/java/eu/etaxonomy/cdm/vaadin/container/IdAndUuid.java -text |
|
10 | 12 |
src/main/java/eu/etaxonomy/cdm/vaadin/container/LeafNodeTaxonContainer.java -text |
11 | 13 |
src/main/java/eu/etaxonomy/cdm/vaadin/model/BeanItemContainerExample.java -text |
12 | 14 |
src/main/java/eu/etaxonomy/cdm/vaadin/model/CdmTaxonTableCollection.java -text |
... | ... | |
19 | 21 |
src/main/java/eu/etaxonomy/cdm/vaadin/model/Users.java -text |
20 | 22 |
src/main/java/eu/etaxonomy/cdm/vaadin/model/taxonDTO.java -text |
21 | 23 |
src/main/java/eu/etaxonomy/cdm/vaadin/presenter/AuthenticationPresenter.java -text |
24 |
src/main/java/eu/etaxonomy/cdm/vaadin/presenter/NewTaxonBasePresenter.java -text |
|
22 | 25 |
src/main/java/eu/etaxonomy/cdm/vaadin/presenter/StatusPresenter.java -text |
23 | 26 |
src/main/java/eu/etaxonomy/cdm/vaadin/presenter/dbstatus/DistributionSelectionPresenter.java -text |
24 | 27 |
src/main/java/eu/etaxonomy/cdm/vaadin/presenter/dbstatus/DistributionTablePresenter.java -text |
25 | 28 |
src/main/java/eu/etaxonomy/cdm/vaadin/servlet/CdmVaadinConversationalServlet.java -text |
29 |
src/main/java/eu/etaxonomy/cdm/vaadin/session/CdmChangeEvent.java -text |
|
30 |
src/main/java/eu/etaxonomy/cdm/vaadin/session/CdmDataChangeService.java -text |
|
31 |
src/main/java/eu/etaxonomy/cdm/vaadin/session/ICdmChangeListener.java -text |
|
26 | 32 |
src/main/java/eu/etaxonomy/cdm/vaadin/statement/CdmStatementDelegate.java -text |
27 | 33 |
src/main/java/eu/etaxonomy/cdm/vaadin/ui/AbstractAuthenticatedUI.java -text |
34 |
src/main/java/eu/etaxonomy/cdm/vaadin/ui/CdmBaseUI.java -text |
|
28 | 35 |
src/main/java/eu/etaxonomy/cdm/vaadin/ui/CheckUI.java -text |
29 | 36 |
src/main/java/eu/etaxonomy/cdm/vaadin/ui/DbStatusUI.java -text |
30 | 37 |
src/main/java/eu/etaxonomy/cdm/vaadin/ui/StatusEditorUI.java -text |
31 | 38 |
src/main/java/eu/etaxonomy/cdm/vaadin/util/CdmQueryFactory.java -text |
32 | 39 |
src/main/java/eu/etaxonomy/cdm/vaadin/util/CdmSQLStringDecorator.java -text |
33 | 40 |
src/main/java/eu/etaxonomy/cdm/vaadin/util/CdmSpringContextHelper.java -text |
41 |
src/main/java/eu/etaxonomy/cdm/vaadin/util/CdmVaadinSessionUtilities.java -text |
|
42 |
src/main/java/eu/etaxonomy/cdm/vaadin/util/CdmVaadinUtilities.java -text |
|
43 |
src/main/java/eu/etaxonomy/cdm/vaadin/util/SQLUtils.java -text |
|
34 | 44 |
src/main/java/eu/etaxonomy/cdm/vaadin/view/AuthenticationView.java -text |
35 | 45 |
src/main/java/eu/etaxonomy/cdm/vaadin/view/IAuthenticationComponent.java -text |
46 |
src/main/java/eu/etaxonomy/cdm/vaadin/view/INewTaxonBaseComponentListener.java -text |
|
47 |
src/main/java/eu/etaxonomy/cdm/vaadin/view/INewTaxonBaseComposite.java -text |
|
36 | 48 |
src/main/java/eu/etaxonomy/cdm/vaadin/view/IStatusComposite.java -text |
37 | 49 |
src/main/java/eu/etaxonomy/cdm/vaadin/view/StatusEditorView.java -text |
38 | 50 |
src/main/java/eu/etaxonomy/cdm/vaadin/view/dbstatus/DistributionSelectionView.java -text |
src/main/java/eu/etaxonomy/cdm/vaadin/component/NewTaxonBaseComposite.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2015 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 |
package eu.etaxonomy.cdm.vaadin.component; |
|
11 |
|
|
12 |
import java.util.Arrays; |
|
13 |
|
|
14 |
import com.vaadin.annotations.AutoGenerated; |
|
15 |
import com.vaadin.data.Validator.EmptyValueException; |
|
16 |
import com.vaadin.server.Page; |
|
17 |
import com.vaadin.ui.Alignment; |
|
18 |
import com.vaadin.ui.Button; |
|
19 |
import com.vaadin.ui.Button.ClickEvent; |
|
20 |
import com.vaadin.ui.ComboBox; |
|
21 |
import com.vaadin.ui.CustomComponent; |
|
22 |
import com.vaadin.ui.GridLayout; |
|
23 |
import com.vaadin.ui.Label; |
|
24 |
import com.vaadin.ui.Notification; |
|
25 |
import com.vaadin.ui.Notification.Type; |
|
26 |
import com.vaadin.ui.TextField; |
|
27 |
import com.vaadin.ui.UI; |
|
28 |
import com.vaadin.ui.Window; |
|
29 |
|
|
30 |
import eu.etaxonomy.cdm.vaadin.container.IdAndUuid; |
|
31 |
import eu.etaxonomy.cdm.vaadin.session.CdmChangeEvent; |
|
32 |
import eu.etaxonomy.cdm.vaadin.session.CdmChangeEvent.Action; |
|
33 |
import eu.etaxonomy.cdm.vaadin.util.CdmVaadinSessionUtilities; |
|
34 |
import eu.etaxonomy.cdm.vaadin.view.INewTaxonBaseComponentListener; |
|
35 |
import eu.etaxonomy.cdm.vaadin.view.INewTaxonBaseComposite; |
|
36 |
|
|
37 |
/** |
|
38 |
* @author cmathew |
|
39 |
* @date 2 Apr 2015 |
|
40 |
* |
|
41 |
*/ |
|
42 |
public class NewTaxonBaseComposite extends CustomComponent implements INewTaxonBaseComposite { |
|
43 |
|
|
44 |
/*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */ |
|
45 |
|
|
46 |
@AutoGenerated |
|
47 |
private GridLayout mainLayout; |
|
48 |
@AutoGenerated |
|
49 |
private Button cancelButton; |
|
50 |
@AutoGenerated |
|
51 |
private Button saveButton; |
|
52 |
@AutoGenerated |
|
53 |
private ComboBox secComboBox; |
|
54 |
@AutoGenerated |
|
55 |
private Label secLabel; |
|
56 |
@AutoGenerated |
|
57 |
private TextField nameTextField; |
|
58 |
@AutoGenerated |
|
59 |
private Label nameLabel; |
|
60 |
private INewTaxonBaseComponentListener listener; |
|
61 |
|
|
62 |
|
|
63 |
private final Window dialog; |
|
64 |
private final IdAndUuid accTaxonIdUuid; |
|
65 |
/** |
|
66 |
* The constructor should first build the main layout, set the |
|
67 |
* composition root and then do any custom initialization. |
|
68 |
* |
|
69 |
* The constructor will not be automatically regenerated by the |
|
70 |
* visual editor. |
|
71 |
*/ |
|
72 |
public NewTaxonBaseComposite(Window dialog, INewTaxonBaseComponentListener listener, IdAndUuid accTaxonIdUuid) { |
|
73 |
buildMainLayout(); |
|
74 |
setCompositionRoot(mainLayout); |
|
75 |
|
|
76 |
this.listener = listener; |
|
77 |
this.dialog = dialog; |
|
78 |
this.accTaxonIdUuid = accTaxonIdUuid; |
|
79 |
addUIListeners(); |
|
80 |
|
|
81 |
init(); |
|
82 |
} |
|
83 |
|
|
84 |
public void init() { |
|
85 |
initNameTextField(); |
|
86 |
initSecComboBox(); |
|
87 |
} |
|
88 |
|
|
89 |
private void initNameTextField() { |
|
90 |
//nameTextField.addValidator(new StringLengthValidator("Name cannot be empty", 1,100, false)); |
|
91 |
} |
|
92 |
|
|
93 |
private void initSecComboBox() { |
|
94 |
|
|
95 |
secComboBox.setNullSelectionAllowed(false); |
|
96 |
secComboBox.setItemCaptionPropertyId("titleCache"); |
|
97 |
secComboBox.setImmediate(true); |
|
98 |
if(listener != null) { |
|
99 |
secComboBox.setContainerDataSource(listener.getSecRefContainer()); |
|
100 |
} |
|
101 |
} |
|
102 |
|
|
103 |
private void addUIListeners() { |
|
104 |
addSaveButtonListener(); |
|
105 |
addCancelButtonListener(); |
|
106 |
} |
|
107 |
|
|
108 |
private void addSaveButtonListener() { |
|
109 |
saveButton.addClickListener(new Button.ClickListener() { |
|
110 |
|
|
111 |
@Override |
|
112 |
public void buttonClick(ClickEvent event) { |
|
113 |
try { |
|
114 |
nameTextField.validate(); |
|
115 |
secComboBox.validate(); |
|
116 |
|
|
117 |
IdAndUuid taxonIdUuid; |
|
118 |
if(accTaxonIdUuid == null) { |
|
119 |
taxonIdUuid = listener.newTaxon(nameTextField.getValue(),secComboBox.getValue()); |
|
120 |
} else { |
|
121 |
listener.newSynonym(nameTextField.getValue(),secComboBox.getValue(), accTaxonIdUuid.getUuid()); |
|
122 |
taxonIdUuid = accTaxonIdUuid; |
|
123 |
} |
|
124 |
CdmVaadinSessionUtilities.getCurrentCdmDataChangeService() |
|
125 |
.fireChangeEvent(new CdmChangeEvent(Action.Create, Arrays.asList(taxonIdUuid.getId()), NewTaxonBaseComposite.class), true); |
|
126 |
UI.getCurrent().removeWindow(dialog); |
|
127 |
} catch (EmptyValueException e) { |
|
128 |
Notification notification = new Notification("Invalid input", "Neither Name or Secundum can be empty", Type.WARNING_MESSAGE); |
|
129 |
notification.setDelayMsec(2000); |
|
130 |
notification.show(Page.getCurrent()); |
|
131 |
} |
|
132 |
} |
|
133 |
|
|
134 |
}); |
|
135 |
} |
|
136 |
|
|
137 |
private void addCancelButtonListener() { |
|
138 |
cancelButton.addClickListener(new Button.ClickListener() { |
|
139 |
|
|
140 |
@Override |
|
141 |
public void buttonClick(ClickEvent event) { |
|
142 |
UI.getCurrent().removeWindow(dialog); |
|
143 |
} |
|
144 |
|
|
145 |
}); |
|
146 |
} |
|
147 |
|
|
148 |
/* (non-Javadoc) |
|
149 |
* @see eu.etaxonomy.cdm.vaadin.view.INewTaxonComposite#setListener(eu.etaxonomy.cdm.vaadin.view.INewTaxonBaseComponentListener) |
|
150 |
*/ |
|
151 |
@Override |
|
152 |
public void setListener(INewTaxonBaseComponentListener listener) { |
|
153 |
this.listener = listener; |
|
154 |
|
|
155 |
} |
|
156 |
|
|
157 |
@AutoGenerated |
|
158 |
private GridLayout buildMainLayout() { |
|
159 |
// common part: create layout |
|
160 |
mainLayout = new GridLayout(); |
|
161 |
mainLayout.setImmediate(false); |
|
162 |
mainLayout.setWidth("320px"); |
|
163 |
mainLayout.setHeight("120px"); |
|
164 |
mainLayout.setMargin(true); |
|
165 |
mainLayout.setSpacing(true); |
|
166 |
mainLayout.setColumns(2); |
|
167 |
mainLayout.setRows(3); |
|
168 |
|
|
169 |
// top-level component properties |
|
170 |
setWidth("320px"); |
|
171 |
setHeight("120px"); |
|
172 |
|
|
173 |
// nameLabel |
|
174 |
nameLabel = new Label(); |
|
175 |
nameLabel.setImmediate(false); |
|
176 |
nameLabel.setWidth("-1px"); |
|
177 |
nameLabel.setHeight("-1px"); |
|
178 |
nameLabel.setValue("Name : "); |
|
179 |
mainLayout.addComponent(nameLabel, 0, 0); |
|
180 |
mainLayout.setComponentAlignment(nameLabel, new Alignment(34)); |
|
181 |
|
|
182 |
// nameTextField |
|
183 |
nameTextField = new TextField(); |
|
184 |
nameTextField.setImmediate(false); |
|
185 |
nameTextField.setWidth("190px"); |
|
186 |
nameTextField.setHeight("-1px"); |
|
187 |
nameTextField.setInvalidAllowed(false); |
|
188 |
nameTextField.setRequired(true); |
|
189 |
mainLayout.addComponent(nameTextField, 1, 0); |
|
190 |
mainLayout.setComponentAlignment(nameTextField, new Alignment(33)); |
|
191 |
|
|
192 |
// secLabel |
|
193 |
secLabel = new Label(); |
|
194 |
secLabel.setImmediate(false); |
|
195 |
secLabel.setWidth("-1px"); |
|
196 |
secLabel.setHeight("-1px"); |
|
197 |
secLabel.setValue("Secundum : "); |
|
198 |
mainLayout.addComponent(secLabel, 0, 1); |
|
199 |
mainLayout.setComponentAlignment(secLabel, new Alignment(34)); |
|
200 |
|
|
201 |
// secComboBox |
|
202 |
secComboBox = new ComboBox(); |
|
203 |
secComboBox.setImmediate(false); |
|
204 |
secComboBox.setWidth("190px"); |
|
205 |
secComboBox.setHeight("-1px"); |
|
206 |
secComboBox.setInvalidAllowed(false); |
|
207 |
secComboBox.setRequired(true); |
|
208 |
mainLayout.addComponent(secComboBox, 1, 1); |
|
209 |
mainLayout.setComponentAlignment(secComboBox, new Alignment(33)); |
|
210 |
|
|
211 |
// saveButton |
|
212 |
saveButton = new Button(); |
|
213 |
saveButton.setCaption("Save"); |
|
214 |
saveButton.setImmediate(true); |
|
215 |
saveButton.setWidth("-1px"); |
|
216 |
saveButton.setHeight("-1px"); |
|
217 |
mainLayout.addComponent(saveButton, 0, 2); |
|
218 |
mainLayout.setComponentAlignment(saveButton, new Alignment(34)); |
|
219 |
|
|
220 |
// cancelButton |
|
221 |
cancelButton = new Button(); |
|
222 |
cancelButton.setCaption("Cancel"); |
|
223 |
cancelButton.setImmediate(true); |
|
224 |
cancelButton.setWidth("-1px"); |
|
225 |
cancelButton.setHeight("-1px"); |
|
226 |
mainLayout.addComponent(cancelButton, 1, 2); |
|
227 |
mainLayout.setComponentAlignment(cancelButton, new Alignment(33)); |
|
228 |
|
|
229 |
return mainLayout; |
|
230 |
} |
|
231 |
|
|
232 |
|
|
233 |
} |
src/main/java/eu/etaxonomy/cdm/vaadin/component/StatusComposite.java | ||
---|---|---|
12 | 12 |
import java.sql.SQLException; |
13 | 13 |
import java.util.ArrayList; |
14 | 14 |
import java.util.List; |
15 |
import java.util.Set; |
|
15 | 16 |
|
16 | 17 |
import org.apache.log4j.Logger; |
17 | 18 |
|
... | ... | |
44 | 45 |
import com.vaadin.ui.Table.ColumnHeaderMode; |
45 | 46 |
import com.vaadin.ui.TextField; |
46 | 47 |
import com.vaadin.ui.TreeTable; |
48 |
import com.vaadin.ui.UI; |
|
47 | 49 |
import com.vaadin.ui.VerticalLayout; |
50 |
import com.vaadin.ui.Window; |
|
48 | 51 |
|
52 |
import eu.etaxonomy.cdm.vaadin.container.IdAndUuid; |
|
49 | 53 |
import eu.etaxonomy.cdm.vaadin.container.LeafNodeTaxonContainer; |
54 |
import eu.etaxonomy.cdm.vaadin.presenter.NewTaxonBasePresenter; |
|
55 |
import eu.etaxonomy.cdm.vaadin.session.CdmChangeEvent; |
|
56 |
import eu.etaxonomy.cdm.vaadin.session.ICdmChangeListener; |
|
57 |
import eu.etaxonomy.cdm.vaadin.util.CdmVaadinSessionUtilities; |
|
50 | 58 |
import eu.etaxonomy.cdm.vaadin.view.IStatusComposite; |
51 | 59 |
|
52 | 60 |
/** |
... | ... | |
54 | 62 |
* @date 11 Mar 2015 |
55 | 63 |
* |
56 | 64 |
*/ |
57 |
public class StatusComposite extends CustomComponent implements IStatusComposite { |
|
65 |
public class StatusComposite extends CustomComponent implements IStatusComposite, ICdmChangeListener {
|
|
58 | 66 |
|
59 | 67 |
/*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */ |
60 | 68 |
|
... | ... | |
92 | 100 |
|
93 | 101 |
private static final String SELECT_FILTER = "Select filter ..."; |
94 | 102 |
private static final String SELECT_CLASSIFICATION = "Select classification ..."; |
95 |
private static final String ADD_TAXON_SYNONYM = "Add ..."; |
|
103 |
|
|
104 |
private static final String ADD_TAXON_SYNONYM_INPUT = "Add ..."; |
|
105 |
private static final String ADD_TAXON = "New Accepted Taxon"; |
|
106 |
private static final String ADD_SYNONYM = "New Synonym"; |
|
107 |
|
|
96 | 108 |
private static final String PROPERTY_FILTER_ID = "filter"; |
97 | 109 |
private static final String PROPERTY_SELECTED_ID = "selected"; |
98 | 110 |
|
... | ... | |
116 | 128 |
buildMainLayout(); |
117 | 129 |
setCompositionRoot(mainLayout); |
118 | 130 |
|
131 |
CdmVaadinSessionUtilities.getCurrentCdmDataChangeService().register(this); |
|
119 | 132 |
addUIListeners(); |
120 | 133 |
|
121 | 134 |
initAddComboBox(); |
... | ... | |
145 | 158 |
private void initTaxaTable(int classificationId) { |
146 | 159 |
|
147 | 160 |
taxaTreeTable.setSelectable(true); |
161 |
taxaTreeTable.setMultiSelect(true); |
|
148 | 162 |
taxaTreeTable.setImmediate(false); |
149 | 163 |
|
150 | 164 |
if(listener != null) { |
... | ... | |
294 | 308 |
private void initAddComboBox() { |
295 | 309 |
addComboBox.setNullSelectionAllowed(false); |
296 | 310 |
addComboBox.setImmediate(true); |
297 |
addComboBox.addItem(ADD_TAXON_SYNONYM); |
|
298 |
addComboBox.addItem("New Accepted Taxon");
|
|
299 |
addComboBox.addItem("New Synonym");
|
|
300 |
addComboBox.setValue(ADD_TAXON_SYNONYM); |
|
311 |
addComboBox.addItem(ADD_TAXON_SYNONYM_INPUT);
|
|
312 |
addComboBox.addItem(ADD_TAXON);
|
|
313 |
addComboBox.addItem(ADD_SYNONYM);
|
|
314 |
addComboBox.setValue(ADD_TAXON_SYNONYM_INPUT);
|
|
301 | 315 |
|
302 | 316 |
} |
303 | 317 |
|
... | ... | |
320 | 334 |
|
321 | 335 |
addClassificationComboBoxListener(); |
322 | 336 |
addAddComboBoxListener(); |
337 |
addRemoveButtonListener(); |
|
323 | 338 |
addSearchTextFieldListener(); |
324 | 339 |
addClearSearchButtonListener(); |
325 | 340 |
} |
... | ... | |
354 | 369 |
public void valueChange(ValueChangeEvent event) { |
355 | 370 |
if (addComboBox.getValue() != null) { |
356 | 371 |
String selected = (String)addComboBox.getValue(); |
357 |
if(!selected.equals(ADD_TAXON_SYNONYM)) { |
|
358 |
Notification.show(selected, "Implement me", Type.WARNING_MESSAGE); |
|
359 |
addComboBox.setValue(ADD_TAXON_SYNONYM); |
|
372 |
if(!selected.equals(ADD_TAXON_SYNONYM_INPUT)) { |
|
373 |
try { |
|
374 |
String windowTitle; |
|
375 |
|
|
376 |
Object selectedItemId = null; |
|
377 |
IdAndUuid accTaxonIdUuid = null; |
|
378 |
if(selected.equals(ADD_SYNONYM)) { |
|
379 |
Set<Object> selectedIds = (Set<Object>)taxaTreeTable.getValue(); |
|
380 |
// if zero or more than one items (taxa / synonyms) are selected |
|
381 |
// throw a warning |
|
382 |
if(selectedIds.size() == 0) { |
|
383 |
Notification.show("Multiple or No selection", "Please select a single Taxon", Type.WARNING_MESSAGE); |
|
384 |
return; |
|
385 |
} |
|
386 |
// if a synonym is selected then throw warning |
|
387 |
if(listener.isSynonym(selected)) { |
|
388 |
Notification.show("Synonym selected", "Please choose a Taxon", Type.WARNING_MESSAGE); |
|
389 |
return; |
|
390 |
} |
|
391 |
windowTitle = "Add New Synonym"; |
|
392 |
selectedItemId = selectedIds.iterator().next(); |
|
393 |
accTaxonIdUuid = new IdAndUuid(selectedItemId, listener.getCurrentLeafNodeTaxonContainer().getUuid(selectedItemId)); |
|
394 |
} else { |
|
395 |
windowTitle = "Add New Taxon"; |
|
396 |
} |
|
397 |
|
|
398 |
try { |
|
399 |
Window dialog = new Window(windowTitle); |
|
400 |
dialog.setModal(true); |
|
401 |
UI.getCurrent().addWindow(dialog); |
|
402 |
|
|
403 |
NewTaxonBaseComposite newTaxonComponent = |
|
404 |
new NewTaxonBaseComposite(dialog, |
|
405 |
new NewTaxonBasePresenter(), |
|
406 |
accTaxonIdUuid); |
|
407 |
dialog.setContent(newTaxonComponent); |
|
408 |
} catch (SQLException e) { |
|
409 |
// TODO Auto-generated catch block |
|
410 |
e.printStackTrace(); |
|
411 |
} |
|
412 |
} finally { |
|
413 |
addComboBox.setValue(ADD_TAXON_SYNONYM_INPUT); |
|
414 |
} |
|
360 | 415 |
} |
361 | 416 |
} |
362 | 417 |
} |
... | ... | |
391 | 446 |
}); |
392 | 447 |
} |
393 | 448 |
|
449 |
private void addRemoveButtonListener() { |
|
450 |
removeButton.addClickListener(new Button.ClickListener() { |
|
451 |
|
|
452 |
@Override |
|
453 |
public void buttonClick(ClickEvent event) { |
|
454 |
Set<Object> selectedItemIds = (Set)taxaTreeTable.getValue(); |
|
455 |
if(selectedItemIds.isEmpty()) { |
|
456 |
Notification.show("No Taxa / Synonyms selected", "Please select taxa or synonyms to delete", Type.WARNING_MESSAGE); |
|
457 |
} else { |
|
458 |
Notification.show("Deleting selected Taxa / Synonyms", "Implement me", Type.WARNING_MESSAGE); |
|
459 |
} |
|
460 |
} |
|
461 |
|
|
462 |
}); |
|
463 |
} |
|
464 |
|
|
394 | 465 |
|
395 | 466 |
|
396 | 467 |
/* (non-Javadoc) |
... | ... | |
609 | 680 |
return searchHorizontalLayout; |
610 | 681 |
} |
611 | 682 |
|
683 |
/* (non-Javadoc) |
|
684 |
* @see eu.etaxonomy.cdm.vaadin.session.ICdmChangeListener#onCreate(eu.etaxonomy.cdm.vaadin.session.CdmChangeEvent) |
|
685 |
*/ |
|
686 |
@Override |
|
687 |
public void onCreate(CdmChangeEvent event) { |
|
688 |
if(event.getSourceType().equals(NewTaxonBaseComposite.class)) { |
|
689 |
Object itemId = event.getChangedObjects().get(0); |
|
690 |
listener.getCurrentLeafNodeTaxonContainer().removeTaxonFromCache(itemId); |
|
691 |
// FIXME : not really sure at the moment how to refresh a single node (taxon) |
|
692 |
// in the tree table. As a workaround the node is explicitly collapsed |
|
693 |
// so that when the user expands the synonyms will be refreshed |
|
694 |
taxaTreeTable.setCollapsed(itemId, true); |
|
695 |
taxaTreeTable.setValue(itemId); |
|
696 |
} |
|
697 |
|
|
698 |
} |
|
699 |
|
|
700 |
/* (non-Javadoc) |
|
701 |
* @see eu.etaxonomy.cdm.vaadin.session.ICdmChangeListener#onUpdate(eu.etaxonomy.cdm.vaadin.session.CdmChangeEvent) |
|
702 |
*/ |
|
703 |
@Override |
|
704 |
public void onUpdate(CdmChangeEvent event) { |
|
705 |
// TODO Auto-generated method stub |
|
706 |
|
|
707 |
} |
|
708 |
|
|
709 |
/* (non-Javadoc) |
|
710 |
* @see eu.etaxonomy.cdm.vaadin.session.ICdmChangeListener#onDelete(eu.etaxonomy.cdm.vaadin.session.CdmChangeEvent) |
|
711 |
*/ |
|
712 |
@Override |
|
713 |
public void onDelete(CdmChangeEvent event) { |
|
714 |
// TODO Auto-generated method stub |
|
715 |
|
|
716 |
} |
|
717 |
|
|
612 | 718 |
} |
src/main/java/eu/etaxonomy/cdm/vaadin/container/CdmSQLContainer.java | ||
---|---|---|
1 | 1 |
package eu.etaxonomy.cdm.vaadin.container; |
2 | 2 |
|
3 |
import java.sql.DatabaseMetaData; |
|
3 | 4 |
import java.sql.SQLException; |
4 | 5 |
import java.util.HashMap; |
5 | 6 |
import java.util.Map; |
7 |
import java.util.UUID; |
|
6 | 8 |
|
7 | 9 |
import org.apache.log4j.Logger; |
8 | 10 |
|
9 | 11 |
import com.vaadin.data.Item; |
12 |
import com.vaadin.data.Property; |
|
10 | 13 |
import com.vaadin.data.util.sqlcontainer.RowId; |
11 | 14 |
import com.vaadin.data.util.sqlcontainer.RowItem; |
12 | 15 |
import com.vaadin.data.util.sqlcontainer.SQLContainer; |
13 | 16 |
import com.vaadin.data.util.sqlcontainer.connection.JDBCConnectionPool; |
14 | 17 |
import com.vaadin.data.util.sqlcontainer.query.QueryDelegate; |
15 |
import com.vaadin.data.util.sqlcontainer.query.TableQuery; |
|
16 | 18 |
|
19 |
import eu.etaxonomy.cdm.vaadin.util.CdmQueryFactory; |
|
17 | 20 |
import eu.etaxonomy.cdm.vaadin.util.CdmSpringContextHelper; |
21 |
import eu.etaxonomy.cdm.vaadin.util.SQLUtils; |
|
18 | 22 |
|
19 | 23 |
public class CdmSQLContainer extends SQLContainer { |
20 | 24 |
|
... | ... | |
22 | 26 |
|
23 | 27 |
JDBCConnectionPool pool; |
24 | 28 |
|
25 |
private int contentChangedEventsDisabledCount = 0; |
|
26 | 29 |
|
27 |
private boolean contentsChangedEventPending;
|
|
30 |
private final Map<RowId, RowItem> tempItems = new HashMap<RowId, RowItem>();
|
|
28 | 31 |
|
29 |
private final Map<RowId, RowItem> addedItems = new HashMap<RowId, RowItem>(); |
|
32 |
DatabaseMetaData databaseMetaData; |
|
33 |
|
|
34 |
boolean checkPropertyIdCase = false; |
|
30 | 35 |
|
31 | 36 |
public CdmSQLContainer(QueryDelegate delegate) throws SQLException { |
32 | 37 |
super(delegate); |
38 |
databaseMetaData = CdmSpringContextHelper.getCurrent().getConnection().getMetaData(); |
|
33 | 39 |
} |
34 | 40 |
|
35 | 41 |
public static CdmSQLContainer newInstance(String tableName) throws SQLException { |
36 |
// TODO : currently the sql generator is for h2, need to make this compatible for all flavours |
|
37 |
TableQuery tq = new TableQuery(tableName,CdmSpringContextHelper.getConnectionPool()); |
|
38 |
tq.setVersionColumn("updated"); |
|
39 |
return new CdmSQLContainer(tq); |
|
42 |
// TODO : currently the sql generator is for h2, need to make this compatible for all flavours |
|
43 |
//TableQuery tq = new TableQuery(tableName, CdmSpringContextHelper.getCurrent().getConnectionPool(), new DefaultSQLGenerator()); |
|
44 |
//tq.setVersionColumn("updated"); |
|
40 | 45 |
|
46 |
CdmSQLContainer container = new CdmSQLContainer(CdmQueryFactory.generateTableQuery(tableName)); |
|
47 |
container.checkPropertyIdCase = true; |
|
48 |
return container; |
|
41 | 49 |
} |
42 | 50 |
|
51 |
|
|
43 | 52 |
@Override |
44 | 53 |
public Item getItem(Object itemId) { |
45 |
RowItem rowItem = addedItems.get(itemId);
|
|
54 |
RowItem rowItem = tempItems.get(itemId);
|
|
46 | 55 |
if(rowItem != null) { |
47 | 56 |
return rowItem; |
48 | 57 |
} else { |
... | ... | |
50 | 59 |
} |
51 | 60 |
} |
52 | 61 |
|
53 |
public void addRowItem(RowItem rowItem) { |
|
54 |
addedItems.put(rowItem.getId(), rowItem); |
|
62 |
@Override |
|
63 |
public boolean removeAllItems() throws UnsupportedOperationException { |
|
64 |
tempItems.clear(); |
|
65 |
return super.removeAllItems(); |
|
55 | 66 |
} |
56 | 67 |
|
57 | 68 |
@Override |
58 |
protected void fireContentsChange() { |
|
59 |
if (contentsChangeEventsOn()) { |
|
60 |
disableContentsChangeEvents(); |
|
61 |
try { |
|
62 |
super.fireContentsChange(); |
|
63 |
} finally { |
|
64 |
enableContentsChangeEvents(); |
|
65 |
} |
|
66 |
} else { |
|
67 |
contentsChangedEventPending = true; |
|
68 |
} |
|
69 |
public void refresh() { |
|
70 |
tempItems.clear(); |
|
71 |
super.refresh(); |
|
69 | 72 |
} |
70 | 73 |
|
71 |
protected boolean contentsChangeEventsOn() {
|
|
72 |
return contentChangedEventsDisabledCount == 0;
|
|
74 |
public UUID getUuid(Object itemId) {
|
|
75 |
return UUID.fromString((String)getProperty(itemId,CdmQueryFactory.UUID_ID).getValue());
|
|
73 | 76 |
} |
74 | 77 |
|
75 |
protected void disableContentsChangeEvents() { |
|
76 |
contentChangedEventsDisabledCount++; |
|
78 |
|
|
79 |
public void addTempItem(RowItem rowItem) { |
|
80 |
tempItems.put(rowItem.getId(), rowItem); |
|
81 |
|
|
77 | 82 |
} |
78 | 83 |
|
79 |
protected void enableContentsChangeEvents() { |
|
80 |
if (contentChangedEventsDisabledCount <= 0) { |
|
81 |
logger.warn("Mismatched calls to disable and enable contents change events in HierarchicalContainer"); |
|
82 |
contentChangedEventsDisabledCount = 0; |
|
83 |
} else { |
|
84 |
contentChangedEventsDisabledCount--; |
|
85 |
} |
|
86 |
if (contentChangedEventsDisabledCount == 0) { |
|
87 |
if (contentsChangedEventPending) { |
|
88 |
//fireContentsChange(); |
|
84 |
public Property<?> getProperty(Object itemId, Object propertyId) { |
|
85 |
if(checkPropertyIdCase) { |
|
86 |
try { |
|
87 |
return getItem(itemId).getItemProperty(SQLUtils.correctCase(propertyId.toString(), databaseMetaData)); |
|
88 |
} catch (SQLException e) { |
|
89 |
logger.warn("Error getting property", e); |
|
90 |
return null; |
|
89 | 91 |
} |
90 |
contentsChangedEventPending = false; |
|
92 |
} else { |
|
93 |
return getItem(itemId).getItemProperty(propertyId); |
|
91 | 94 |
} |
92 | 95 |
} |
93 | 96 |
|
src/main/java/eu/etaxonomy/cdm/vaadin/container/IdAndUuid.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2015 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 |
package eu.etaxonomy.cdm.vaadin.container; |
|
11 |
|
|
12 |
import java.util.UUID; |
|
13 |
|
|
14 |
/** |
|
15 |
* @author cmathew |
|
16 |
* @date 7 Apr 2015 |
|
17 |
* |
|
18 |
*/ |
|
19 |
public class IdAndUuid { |
|
20 |
|
|
21 |
private final Object id; |
|
22 |
private final UUID uuid; |
|
23 |
|
|
24 |
public IdAndUuid(Object id, UUID uuid) { |
|
25 |
|
|
26 |
if(id == null || uuid == null) { |
|
27 |
throw new IllegalArgumentException("Neither Id nor Uuid can be null"); |
|
28 |
} |
|
29 |
this.id = id; |
|
30 |
this.uuid = uuid; |
|
31 |
} |
|
32 |
|
|
33 |
/** |
|
34 |
* @return the id |
|
35 |
*/ |
|
36 |
public Object getId() { |
|
37 |
return id; |
|
38 |
} |
|
39 |
|
|
40 |
/** |
|
41 |
* @return the uuid |
|
42 |
*/ |
|
43 |
public UUID getUuid() { |
|
44 |
return uuid; |
|
45 |
} |
|
46 |
|
|
47 |
} |
src/main/java/eu/etaxonomy/cdm/vaadin/container/LeafNodeTaxonContainer.java | ||
---|---|---|
39 | 39 |
|
40 | 40 |
private static final Logger logger = Logger.getLogger(LeafNodeTaxonContainer.class); |
41 | 41 |
|
42 |
public static final String ID = "Id"; |
|
43 |
public static final String UUID_ID = "Uuid"; |
|
42 |
|
|
44 | 43 |
public static final String NAME_ID = "Name"; |
45 | 44 |
public static final String ACCTAXON_ID = "AccTaxonId"; |
46 | 45 |
public static final String PB_ID = "Pb"; |
... | ... | |
68 | 67 |
* @throws SQLException |
69 | 68 |
*/ |
70 | 69 |
public LeafNodeTaxonContainer(int classificationId) throws SQLException { |
71 |
super(CdmQueryFactory.generateTaxonBaseQuery(ID, UUID_ID,NAME_ID, PB_ID, UNP_ID, RANK_ID, HAS_SYN_ID));
|
|
72 |
this.synonymContainer = new CdmSQLContainer(CdmQueryFactory.generateSynonymofTaxonQuery(ID, NAME_ID));
|
|
70 |
super(CdmQueryFactory.generateTaxonBaseQuery(NAME_ID, PB_ID, UNP_ID, RANK_ID, HAS_SYN_ID)); |
|
71 |
this.synonymContainer = new CdmSQLContainer(CdmQueryFactory.generateSynonymofTaxonQuery(NAME_ID)); |
|
73 | 72 |
this.classificationId = classificationId; |
74 | 73 |
taxonSynonymMap = new HashMap<Object,List<Object>>(); |
75 | 74 |
initFilters(); |
76 | 75 |
addContainerFilter(classificationFilter); |
77 |
addContainerFilter(rankFilter); |
|
76 |
//addContainerFilter(rankFilter);
|
|
78 | 77 |
} |
79 | 78 |
|
80 | 79 |
private void initFilters() { |
... | ... | |
136 | 135 |
if(synList != null) { |
137 | 136 |
return synList; |
138 | 137 |
} |
139 |
//synonymContainer.disableContentsChangeEvents(); |
|
140 |
try { |
|
141 |
Filter synonymOfTaxonFilter = new Compare.Equal("sr.relatedto_id", Integer.valueOf(itemId.toString())); |
|
142 |
synonymContainer.addContainerFilter(synonymOfTaxonFilter); |
|
143 |
synList = new ArrayList<Object>(); |
|
144 |
synList.addAll(synonymContainer.getItemIds()); |
|
145 |
for(Object synItemId : synList) { |
|
146 |
addRowItem((RowItem) synonymContainer.getItem(synItemId)); |
|
147 |
} |
|
148 |
synonymContainer.removeAllContainerFilters(); |
|
149 |
// cache the synonyms for later |
|
150 |
taxonSynonymMap.put(itemId, synList); |
|
151 | 138 |
|
152 |
return synList; |
|
153 |
} finally { |
|
154 |
//synonymContainer.enableContentsChangeEvents(); |
|
139 |
Filter synonymOfTaxonFilter = new Compare.Equal("sr.relatedto_id", Integer.valueOf(itemId.toString())); |
|
140 |
synonymContainer.addContainerFilter(synonymOfTaxonFilter); |
|
141 |
synList = new ArrayList<Object>(); |
|
142 |
synList.addAll(synonymContainer.getItemIds()); |
|
143 |
for(Object synItemId : synList) { |
|
144 |
addTempItem((RowItem) synonymContainer.getItem(synItemId)); |
|
155 | 145 |
} |
146 |
synonymContainer.removeAllContainerFilters(); |
|
147 |
// cache the synonyms for later |
|
148 |
taxonSynonymMap.put(itemId, synList); |
|
156 | 149 |
|
157 |
|
|
150 |
return synList; |
|
158 | 151 |
} |
159 | 152 |
|
160 | 153 |
/* (non-Javadoc) |
... | ... | |
170 | 163 |
*/ |
171 | 164 |
@Override |
172 | 165 |
public Collection<?> rootItemIds() { |
173 |
// |
|
174 |
// disableContentsChangeEvents(); |
|
175 |
// try { |
|
176 |
// Collection<?> taxontemIds = getItemIds(); |
|
177 |
// return taxontemIds; |
|
178 |
// } finally { |
|
179 |
// enableContentsChangeEvents(); |
|
180 |
// } |
|
181 |
|
|
182 | 166 |
return getItemIds(); |
183 | 167 |
} |
184 | 168 |
|
... | ... | |
229 | 213 |
return true; |
230 | 214 |
} |
231 | 215 |
|
216 |
public boolean isSynonym(Object itemId) { |
|
217 |
return synonymContainer.containsId(itemId); |
|
218 |
} |
|
219 |
|
|
220 |
public void removeTaxonFromCache(Object itemId) { |
|
221 |
taxonSynonymMap.remove(itemId); |
|
222 |
} |
|
232 | 223 |
|
233 | 224 |
|
234 | 225 |
} |
src/main/java/eu/etaxonomy/cdm/vaadin/presenter/AuthenticationPresenter.java | ||
---|---|---|
12 | 12 |
|
13 | 13 |
public class AuthenticationPresenter implements IAuthenticationComponent.AuthenticationComponentListener{ |
14 | 14 |
|
15 |
private AuthenticationView view; |
|
16 |
|
|
15 |
private final AuthenticationView view;
|
|
16 |
|
|
17 | 17 |
public AuthenticationPresenter(AuthenticationView view) { |
18 | 18 |
this.view = view; |
19 | 19 |
view.addListener(this); |
20 | 20 |
} |
21 |
|
|
21 |
|
|
22 | 22 |
@Override |
23 | 23 |
public Authentication login(String userName, String password) { |
24 | 24 |
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(userName, password); |
25 |
AuthenticationManager authenticationManager = (AuthenticationManager) CdmSpringContextHelper.newInstance().getBean("authenticationManager");
|
|
26 |
Authentication authentication = authenticationManager.authenticate(token);
|
|
25 |
AuthenticationManager authenticationManager = (AuthenticationManager) CdmSpringContextHelper.getCurrent().getBean("authenticationManager");
|
|
26 |
Authentication authentication = authenticationManager.authenticate(token); |
|
27 | 27 |
return authentication; |
28 | 28 |
} |
29 | 29 |
|
src/main/java/eu/etaxonomy/cdm/vaadin/presenter/NewTaxonBasePresenter.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2015 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 |
package eu.etaxonomy.cdm.vaadin.presenter; |
|
11 |
|
|
12 |
import java.sql.SQLException; |
|
13 |
import java.util.Arrays; |
|
14 |
import java.util.List; |
|
15 |
import java.util.UUID; |
|
16 |
|
|
17 |
import eu.etaxonomy.cdm.api.service.INameService; |
|
18 |
import eu.etaxonomy.cdm.api.service.IReferenceService; |
|
19 |
import eu.etaxonomy.cdm.api.service.ITaxonService; |
|
20 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
|
21 |
import eu.etaxonomy.cdm.model.name.NonViralName; |
|
22 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
23 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
|
24 |
import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType; |
|
25 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
|
26 |
import eu.etaxonomy.cdm.vaadin.container.CdmSQLContainer; |
|
27 |
import eu.etaxonomy.cdm.vaadin.container.IdAndUuid; |
|
28 |
import eu.etaxonomy.cdm.vaadin.util.CdmSpringContextHelper; |
|
29 |
import eu.etaxonomy.cdm.vaadin.view.INewTaxonBaseComponentListener; |
|
30 |
|
|
31 |
/** |
|
32 |
* @author cmathew |
|
33 |
* @date 2 Apr 2015 |
|
34 |
* |
|
35 |
*/ |
|
36 |
public class NewTaxonBasePresenter implements INewTaxonBaseComponentListener { |
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
private final CdmSQLContainer secRefContainer; |
|
41 |
|
|
42 |
private final IReferenceService referenceService; |
|
43 |
private final ITaxonService taxonService; |
|
44 |
private final INameService nameService; |
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
/* (non-Javadoc) |
|
49 |
* @see eu.etaxonomy.cdm.vaadin.view.INewTaxonBaseComponentListener#getSecRefContainer() |
|
50 |
*/ |
|
51 |
@Override |
|
52 |
public CdmSQLContainer getSecRefContainer() { |
|
53 |
return secRefContainer; |
|
54 |
} |
|
55 |
|
|
56 |
public NewTaxonBasePresenter() throws SQLException { |
|
57 |
|
|
58 |
secRefContainer = CdmSQLContainer.newInstance("Reference"); |
|
59 |
referenceService = CdmSpringContextHelper.getReferenceService(); |
|
60 |
taxonService = CdmSpringContextHelper.getTaxonService(); |
|
61 |
nameService = CdmSpringContextHelper.getNameService(); |
|
62 |
|
|
63 |
|
|
64 |
} |
|
65 |
|
|
66 |
|
|
67 |
/* (non-Javadoc) |
|
68 |
* @see eu.etaxonomy.cdm.vaadin.view.INewTaxonBaseComponentListener#newTaxon(java.lang.String, java.lang.Object) |
|
69 |
*/ |
|
70 |
@Override |
|
71 |
public IdAndUuid newTaxon(String scientificName, Object secRefItemId) { |
|
72 |
UUID uuid = secRefContainer.getUuid(secRefItemId); |
|
73 |
Reference sec = CdmBase.deproxy(referenceService.load(uuid), Reference.class); |
|
74 |
NonViralName name = NonViralName.NewInstance(null); |
|
75 |
name.setTitleCache(scientificName, true); |
|
76 |
nameService.save(name); |
|
77 |
Taxon newTaxon = Taxon.NewInstance(name, sec); |
|
78 |
// TODO : add new TaxonNode since we want to have it show up |
|
79 |
// in the table |
|
80 |
UUID newUuid = taxonService.save(newTaxon); |
|
81 |
return new IdAndUuid(newTaxon.getId(), newUuid); |
|
82 |
} |
|
83 |
|
|
84 |
/* (non-Javadoc) |
|
85 |
* @see eu.etaxonomy.cdm.vaadin.view.INewTaxonBaseComponentListener#newSynonym(java.lang.String, java.lang.Object, java.util.UUID) |
|
86 |
*/ |
|
87 |
@Override |
|
88 |
public IdAndUuid newSynonym(String scientificName, Object secRefItemId, UUID accTaxonUuid) { |
|
89 |
List<String> ACC_TAXON_INIT_STRATEGY = Arrays.asList(new String []{ |
|
90 |
"synonymRelations" |
|
91 |
}); |
|
92 |
|
|
93 |
UUID refUuid = secRefContainer.getUuid(secRefItemId); |
|
94 |
Reference sec = CdmBase.deproxy(referenceService.load(refUuid), Reference.class); |
|
95 |
NonViralName name = NonViralName.NewInstance(null); |
|
96 |
name.setTitleCache(scientificName, true); |
|
97 |
Taxon accTaxon = CdmBase.deproxy(taxonService.load(accTaxonUuid, ACC_TAXON_INIT_STRATEGY), Taxon.class); |
|
98 |
Synonym newSynonym = Synonym.NewInstance(name, sec); |
|
99 |
accTaxon.addSynonym(newSynonym, SynonymRelationshipType.SYNONYM_OF()); |
|
100 |
UUID newUuid = taxonService.save(newSynonym); |
|
101 |
return new IdAndUuid(newSynonym.getId(), newUuid); |
|
102 |
} |
|
103 |
|
|
104 |
|
|
105 |
} |
src/main/java/eu/etaxonomy/cdm/vaadin/presenter/StatusPresenter.java | ||
---|---|---|
19 | 19 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
20 | 20 |
import eu.etaxonomy.cdm.vaadin.container.CdmSQLContainer; |
21 | 21 |
import eu.etaxonomy.cdm.vaadin.container.LeafNodeTaxonContainer; |
22 |
import eu.etaxonomy.cdm.vaadin.util.CdmQueryFactory; |
|
22 | 23 |
import eu.etaxonomy.cdm.vaadin.util.CdmSQLStringDecorator; |
23 | 24 |
import eu.etaxonomy.cdm.vaadin.util.CdmSpringContextHelper; |
24 | 25 |
import eu.etaxonomy.cdm.vaadin.view.IStatusComposite; |
... | ... | |
35 | 36 |
|
36 | 37 |
private LeafNodeTaxonContainer container; |
37 | 38 |
|
38 |
private ITaxonService taxonService; |
|
39 |
private final ITaxonService taxonService;
|
|
39 | 40 |
|
40 | 41 |
private int totalNoOfTaxa = 0; |
41 | 42 |
|
... | ... | |
46 | 47 |
// queries are compatible with all |
47 | 48 |
QueryBuilder.setStringDecorator(new CdmSQLStringDecorator()); |
48 | 49 |
|
49 |
initServices(); |
|
50 |
} |
|
51 |
|
|
52 |
private void initServices() { |
|
53 | 50 |
taxonService = CdmSpringContextHelper.getTaxonService(); |
54 | 51 |
} |
55 | 52 |
|
53 |
|
|
56 | 54 |
@Override |
57 | 55 |
public void removeFilters() { |
58 | 56 |
removeUnplacedFilter(); |
... | ... | |
115 | 113 |
} |
116 | 114 |
|
117 | 115 |
@Override |
118 |
public void addChildren(Object parentItemId) {
|
|
119 |
//container.addChildren(parentItemId);
|
|
116 |
public boolean isSynonym(Object itemId) {
|
|
117 |
return container.isSynonym(itemId);
|
|
120 | 118 |
} |
121 | 119 |
|
122 | 120 |
/* (non-Javadoc) |
... | ... | |
131 | 129 |
|
132 | 130 |
@Override |
133 | 131 |
public void updatePublished(boolean pb, Object itemId) { |
134 |
UUID uuid = UUID.fromString((String)container.getItem(itemId).getItemProperty(LeafNodeTaxonContainer.UUID_ID).getValue());
|
|
132 |
UUID uuid = UUID.fromString((String)container.getItem(itemId).getItemProperty(CdmQueryFactory.UUID_ID).getValue());
|
|
135 | 133 |
Taxon taxon = CdmBase.deproxy(taxonService.load(uuid), Taxon.class); |
136 | 134 |
boolean currentPb = taxon.isPublish(); |
137 | 135 |
if(currentPb != pb) { |
... | ... | |
141 | 139 |
} |
142 | 140 |
|
143 | 141 |
|
142 |
/* (non-Javadoc) |
|
143 |
* @see eu.etaxonomy.cdm.vaadin.view.IStatusComposite.StatusComponentListener#getCurrentLeafNodeTaxonContainer() |
|
144 |
*/ |
|
145 |
@Override |
|
146 |
public LeafNodeTaxonContainer getCurrentLeafNodeTaxonContainer() { |
|
147 |
return container; |
|
148 |
} |
|
149 |
|
|
144 | 150 |
} |
src/main/java/eu/etaxonomy/cdm/vaadin/presenter/dbstatus/DistributionSelectionPresenter.java | ||
---|---|---|
42 | 42 |
|
43 | 43 |
@Override |
44 | 44 |
public List<Classification> getClassificationList() { |
45 |
IClassificationService classificationService = (IClassificationService)CdmSpringContextHelper.newInstance().getBean("classificationServiceImpl"); |
|
46 |
//TODO replace the list by UUID and TITLECACHE |
|
47 |
//classificationService.getUuidAndTitleCache(); |
|
45 |
IClassificationService classificationService = CdmSpringContextHelper.getClassificationService(); |
|
48 | 46 |
List<Classification> classificationList = classificationService.listClassifications(null, null, null, NODE_INIT_STRATEGY()); |
49 | 47 |
return classificationList; |
50 | 48 |
} |
... | ... | |
52 | 50 |
@Override |
53 | 51 |
public List<TermVocabulary<DefinedTermBase>> getNamedAreaList() { |
54 | 52 |
|
55 |
IVocabularyService vocabularyService = (IVocabularyService)CdmSpringContextHelper.newInstance().getBean("vocabularyServiceImpl");
|
|
53 |
IVocabularyService vocabularyService = CdmSpringContextHelper.getVocabularyService();
|
|
56 | 54 |
List<TermVocabulary<DefinedTermBase>> termList = vocabularyService.findByTermType(TermType.NamedArea); |
57 | 55 |
return termList; |
58 | 56 |
} |
src/main/java/eu/etaxonomy/cdm/vaadin/presenter/dbstatus/DistributionTablePresenter.java | ||
---|---|---|
49 | 49 |
private final ITaxonNodeService taxonNodeService; |
50 | 50 |
private final ITermService termService; |
51 | 51 |
private final DistributionTableView view; |
52 |
private ITaxonService taxonService; |
|
52 |
private final ITaxonService taxonService;
|
|
53 | 53 |
|
54 | 54 |
public DistributionTablePresenter(DistributionTableView dtv) throws SQLException{ |
55 | 55 |
this.view = dtv; |
56 | 56 |
view.addListener(this); |
57 |
taxonService = (ITaxonService)CdmSpringContextHelper.newInstance().getBean("taxonServiceImpl");
|
|
58 |
classificationService = (IClassificationService)CdmSpringContextHelper.newInstance().getBean("classificationServiceImpl");
|
|
59 |
taxonNodeService = (ITaxonNodeService)CdmSpringContextHelper.newInstance().getBean("taxonNodeServiceImpl");
|
|
60 |
vocabularyService = (IVocabularyService)CdmSpringContextHelper.newInstance().getBean("vocabularyServiceImpl");
|
|
61 |
descriptionService = (IDescriptionService)CdmSpringContextHelper.newInstance().getBean("descriptionServiceImpl");
|
|
62 |
termService = (ITermService)CdmSpringContextHelper.newInstance().getBean("termServiceImpl");
|
|
57 |
taxonService = CdmSpringContextHelper.getTaxonService();
|
|
58 |
classificationService = CdmSpringContextHelper.getClassificationService();
|
|
59 |
taxonNodeService = CdmSpringContextHelper.getTaxonNodeService();
|
|
60 |
vocabularyService = CdmSpringContextHelper.getVocabularyService();
|
|
61 |
descriptionService = CdmSpringContextHelper.getDescriptionService();
|
|
62 |
termService = CdmSpringContextHelper.getTermService();
|
|
63 | 63 |
view.dataBinding(); |
64 | 64 |
} |
65 | 65 |
|
66 | 66 |
|
67 |
public ComboBox updateDistributionField(DescriptionElementBase deb, |
|
67 |
@Override |
|
68 |
public ComboBox updateDistributionField(DescriptionElementBase deb, |
|
68 | 69 |
Distribution db, |
69 | 70 |
BeanItemContainer<PresenceAbsenceTerm> termContainer, ComboBox box, |
70 | 71 |
Taxon taxon) { |
... | ... | |
81 | 82 |
return term.getTerms(); |
82 | 83 |
} |
83 | 84 |
|
84 |
|
|
85 |
|
|
85 | 86 |
public List<String> getTermList() { |
86 | 87 |
VaadinSession session = VaadinSession.getCurrent(); |
87 | 88 |
UUID termUUID = (UUID) session.getAttribute("selectedTerm"); |
... | ... | |
94 | 95 |
} |
95 | 96 |
return list; |
96 | 97 |
} |
97 |
|
|
98 |
|
|
98 | 99 |
@Override |
99 | 100 |
public HashMap<DescriptionElementBase, Distribution> getDistribution(DefinedTermBase dt, Taxon taxon) { |
100 | 101 |
Set<Feature> setFeature = new HashSet<Feature>(Arrays.asList(Feature.DISTRIBUTION())); |
... | ... | |
116 | 117 |
public List<DescriptionElementBase> listDescriptionElementsForTaxon(Taxon taxon, Set<Feature> setFeature){ |
117 | 118 |
return descriptionService.listDescriptionElementsForTaxon(taxon, setFeature, null, null, null, DESCRIPTION_INIT_STRATEGY); |
118 | 119 |
} |
119 |
|
|
120 |
|
|
120 | 121 |
@Override |
121 | 122 |
public List<Distribution> getDistribution(Taxon taxon) { |
122 | 123 |
Set<Feature> setFeature = new HashSet<Feature>(Arrays.asList(Feature.DISTRIBUTION())); |
123 | 124 |
List<Distribution> listTaxonDescription = descriptionService.listDescriptionElementsForTaxon(taxon, setFeature, null, null, null, DESCRIPTION_INIT_STRATEGY); |
124 | 125 |
return listTaxonDescription; |
125 |
|
|
126 |
|
|
126 | 127 |
} |
127 |
|
|
128 |
|
|
128 | 129 |
@Override |
129 | 130 |
public List<TaxonNode> getAllNodes(int start, int end){ |
130 | 131 |
Classification classification = getChosenClassification(); |
... | ... | |
140 | 141 |
Classification classification = classificationService.load(classificationUUID); |
141 | 142 |
return classification; |
142 | 143 |
} |
143 |
|
|
144 |
|
|
144 | 145 |
@Override |
145 | 146 |
public int getSizeOfClassification(){ |
146 | 147 |
Classification classification = getChosenClassification(); |
147 | 148 |
return taxonNodeService.countAllNodesForClassification(classification); |
148 | 149 |
} |
149 |
|
|
150 |
|
|
150 | 151 |
@Override |
151 | 152 |
public DbTableDTOS getDataList(int start, int end){ |
152 | 153 |
List<TaxonNode> nodes = getAllNodes(start, end); |
... | ... | |
163 | 164 |
// DistributionDTO distributionDTO = new DistributionDTO(db.getStatus().getTitleCache()); |
164 | 165 |
// dbTableDTO.setdDTO(distributionDTO); |
165 | 166 |
} |
166 |
|
|
167 |
|
|
167 | 168 |
} |
168 |
}
|
|
169 |
} |
|
169 | 170 |
items.add(dbTableDTO); |
170 | 171 |
} |
171 | 172 |
return items; |
172 | 173 |
} |
173 |
|
|
174 |
|
|
174 | 175 |
@Override |
175 | 176 |
public CdmSQLContainer getSQLContainer() throws SQLException{ |
176 | 177 |
Classification classification = getChosenClassification(); |
177 | 178 |
int classificationId = classification.getId(); |
178 | 179 |
List<String> termList = getTermList(); |
179 |
CdmSQLContainer container = new CdmSQLContainer(new CdmQueryFactory().generateTaxonDistributionQuery("id", termList, classificationId));
|
|
180 |
CdmSQLContainer container = new CdmSQLContainer(CdmQueryFactory.generateTaxonDistributionQuery(termList, classificationId));
|
|
180 | 181 |
return container; |
181 | 182 |
} |
182 |
|
|
183 |
|
|
183 | 184 |
@Override |
184 | 185 |
public LazyLoadedContainer getLazyLoadedContainer(){ |
185 | 186 |
LazyLoadedContainer lz = new LazyLoadedContainer(CdmTaxonTableCollection.class); |
186 | 187 |
lz.addListener(this); |
187 | 188 |
return lz; |
188 |
|
|
189 |
|
|
189 | 190 |
} |
190 |
|
|
191 |
|
|
191 |
|
|
192 |
|
|
192 | 193 |
@Override |
193 | 194 |
public List<PresenceAbsenceTerm> getPresenceAbsenceTerms() { |
194 | 195 |
//TODO Better to use TermType instead of class to get the list |
... | ... | |
238 | 239 |
public ITermService getTermService() { |
239 | 240 |
return termService; |
240 | 241 |
} |
241 |
|
|
242 |
|
|
242 | 243 |
@Override |
243 | 244 |
public LazyLoadedContainer getTableContainer() { |
244 | 245 |
// TODO Auto-generated method stub |
src/main/java/eu/etaxonomy/cdm/vaadin/servlet/CdmVaadinConversationalServlet.java | ||
---|---|---|
23 | 23 |
private static final Logger logger = Logger.getLogger(CdmVaadinConversationalServlet.class); |
24 | 24 |
|
25 | 25 |
/** |
26 |
*
|
|
26 |
* |
|
27 | 27 |
*/ |
28 | 28 |
private static final long serialVersionUID = -2973231251266766766L; |
29 | 29 |
|
30 |
private ConversationHolder conversation; |
|
31 |
CdmSpringContextHelper helper; |
|
30 |
private ConversationHolder conversation; |
|
32 | 31 |
|
33 | 32 |
|
34 | 33 |
@Override |
35 | 34 |
protected void servletInitialized() throws ServletException { |
36 |
super.servletInitialized();
|
|
35 |
super.servletInitialized(); |
|
37 | 36 |
getService().addSessionInitListener(this); |
38 | 37 |
getService().addSessionDestroyListener(this); |
39 | 38 |
} |
... | ... | |
41 | 40 |
@Override |
42 | 41 |
public void sessionInit(SessionInitEvent event) |
43 | 42 |
throws ServiceException { |
44 |
helper = CdmSpringContextHelper.newInstance(); |
|
45 |
conversation = (ConversationHolder) helper.getBean("conversationHolder"); |
|
43 |
conversation = (ConversationHolder) CdmSpringContextHelper.getCurrent().getBean("conversationHolder"); |
|
46 | 44 |
conversation.bind(); |
47 | 45 |
VaadinSession.getCurrent().setAttribute("conversation", conversation); |
48 | 46 |
} |
... | ... | |
56 | 54 |
protected void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws ServletException, IOException { |
57 | 55 |
if(conversation != null) { |
58 | 56 |
logger.info("Servlet Service call - Binding Vaadin Session Conversation : " + conversation); |
59 |
conversation.bind();
|
|
60 |
}
|
|
61 |
|
|
62 |
super.service(request, response);
|
|
57 |
conversation.bind(); |
|
58 |
} |
|
59 |
|
|
60 |
super.service(request, response); |
|
63 | 61 |
} |
64 | 62 |
|
65 | 63 |
|
src/main/java/eu/etaxonomy/cdm/vaadin/session/CdmChangeEvent.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2015 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 |
package eu.etaxonomy.cdm.vaadin.session; |
|
11 |
|
|
12 |
import java.util.List; |
|
13 |
|
|
14 |
import com.vaadin.ui.Component; |
|
15 |
|
|
16 |
/** |
|
17 |
* @author cmathew |
|
18 |
* @date 7 Apr 2015 |
|
19 |
* |
|
20 |
*/ |
|
21 |
public class CdmChangeEvent { |
|
22 |
|
|
23 |
public enum Action { |
|
24 |
Create, |
|
25 |
Update, |
|
26 |
Delete |
|
27 |
} |
|
28 |
|
|
29 |
private final Action action; |
|
30 |
private final List<Object> changedObjects; |
|
31 |
private final Class<? extends Component> sourceType; |
|
32 |
|
|
33 |
public CdmChangeEvent(Action action, List<Object> changedObjects, Class<? extends Component> sourceType) { |
|
34 |
this.action = action; |
|
35 |
this.changedObjects = changedObjects; |
|
36 |
if(changedObjects == null || changedObjects.isEmpty()) { |
|
37 |
throw new IllegalArgumentException("Changed objects cannot be empty"); |
|
38 |
} |
|
39 |
this.sourceType = sourceType; |
|
40 |
if(sourceType == null) { |
|
41 |
throw new IllegalArgumentException("Source type cannot be null"); |
|
42 |
} |
|
43 |
} |
|
44 |
|
|
45 |
/** |
|
46 |
* @return the action |
|
47 |
*/ |
|
48 |
public Action getAction() { |
|
49 |
return action; |
|
50 |
} |
|
51 |
|
|
52 |
/** |
|
53 |
* @return the changedObjects |
|
54 |
*/ |
|
55 |
public List<Object> getChangedObjects() { |
|
56 |
return changedObjects; |
|
57 |
} |
|
58 |
|
|
59 |
/** |
|
60 |
* @return the sourceType |
|
61 |
*/ |
|
62 |
public Class<? extends Component> getSourceType() { |
|
63 |
return sourceType; |
|
64 |
} |
|
65 |
|
|
66 |
} |
src/main/java/eu/etaxonomy/cdm/vaadin/session/CdmDataChangeService.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2015 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 |
package eu.etaxonomy.cdm.vaadin.session; |
|
11 |
|
|
12 |
import java.util.ArrayList; |
|
13 |
import java.util.List; |
|
14 |
|
|
15 |
import eu.etaxonomy.cdm.vaadin.util.CdmVaadinUtilities; |
|
16 |
|
|
17 |
/** |
|
18 |
* @author cmathew |
|
19 |
* @date 7 Apr 2015 |
|
20 |
* |
|
21 |
*/ |
|
22 |
public class CdmDataChangeService { |
|
23 |
|
|
24 |
public final static String KEY = "cdmDataChangeService"; |
|
25 |
|
|
26 |
private final List<ICdmChangeListener> listeners; |
|
27 |
|
|
28 |
private final List<CdmChangeEvent> currentEvents; |
|
29 |
|
|
30 |
public CdmDataChangeService() { |
|
31 |
listeners = new ArrayList<ICdmChangeListener>(); |
|
32 |
currentEvents = new ArrayList<CdmChangeEvent>(); |
|
33 |
} |
|
34 |
|
|
35 |
public void register(ICdmChangeListener listener) { |
|
36 |
listeners.add(listener); |
|
37 |
} |
|
38 |
|
|
39 |
public void addEvent(CdmChangeEvent event) { |
|
40 |
currentEvents.add(event); |
|
41 |
} |
|
42 |
|
|
43 |
public void fireCurrentChangeEvents(boolean async) { |
|
44 |
for(CdmChangeEvent event : currentEvents) { |
|
45 |
fireChangeEvent(event,async); |
|
46 |
} |
|
47 |
currentEvents.clear(); |
|
48 |
} |
|
49 |
|
|
50 |
public void fireChangeEvent(CdmChangeEvent event, boolean async) { |
|
51 |
switch(event.getAction()) { |
|
52 |
case Create: |
|
53 |
fireCreateChangeEvent(event, async); |
|
54 |
break; |
|
55 |
case Update: |
|
56 |
fireUpdateChangeEvent(event, async); |
|
57 |
break; |
|
58 |
case Delete: |
|
59 |
fireDeleteChangeEvent(event, async); |
|
60 |
break; |
|
61 |
default: |
|
62 |
break; |
|
63 |
} |
|
64 |
} |
|
65 |
|
|
66 |
|
|
67 |
public void fireCreateChangeEvent(final CdmChangeEvent event, boolean async) { |
|
68 |
for(final ICdmChangeListener listener : listeners) { |
|
69 |
if(async) { |
|
70 |
CdmVaadinUtilities.asyncExec(new Runnable() { |
|
71 |
@Override |
|
72 |
public void run() { |
|
73 |
listener.onCreate(event); |
|
74 |
} |
|
75 |
}); |
|
76 |
} else { |
|
77 |
listener.onCreate(event); |
|
78 |
} |
|
79 |
} |
|
80 |
} |
|
81 |
|
|
82 |
public void fireUpdateChangeEvent(final CdmChangeEvent event, boolean async) { |
|
83 |
for(final ICdmChangeListener listener : listeners) { |
|
84 |
if(async) { |
|
85 |
CdmVaadinUtilities.asyncExec(new Runnable() { |
|
86 |
@Override |
|
87 |
public void run() { |
|
88 |
listener.onUpdate(event); |
|
89 |
} |
|
90 |
}); |
|
91 |
} else { |
|
92 |
listener.onUpdate(event); |
|
93 |
} |
|
94 |
} |
|
95 |
} |
|
96 |
|
|
97 |
public void fireDeleteChangeEvent(final CdmChangeEvent event, boolean async) { |
|
98 |
for(final ICdmChangeListener listener : listeners) { |
|
99 |
if(async) { |
|
100 |
CdmVaadinUtilities.asyncExec(new Runnable() { |
|
101 |
@Override |
|
102 |
public void run() { |
|
103 |
listener.onDelete(event); |
|
104 |
} |
|
105 |
}); |
|
106 |
} else { |
|
107 |
listener.onDelete(event); |
|
108 |
} |
|
109 |
} |
|
110 |
} |
|
111 |
|
|
112 |
public void dispose() { |
|
113 |
listeners.clear(); |
|
114 |
currentEvents.clear(); |
|
115 |
} |
|
116 |
} |
src/main/java/eu/etaxonomy/cdm/vaadin/session/ICdmChangeListener.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2015 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 |
package eu.etaxonomy.cdm.vaadin.session; |
|
11 |
|
|
12 |
/** |
|
13 |
* @author cmathew |
|
14 |
* @date 7 Apr 2015 |
|
15 |
* |
|
16 |
*/ |
|
17 |
public interface ICdmChangeListener { |
|
18 |
|
|
19 |
public void onCreate(CdmChangeEvent event); |
|
20 |
public void onUpdate(CdmChangeEvent event); |
|
21 |
public void onDelete(CdmChangeEvent event); |
|
22 |
|
|
23 |
} |
src/main/java/eu/etaxonomy/cdm/vaadin/ui/AbstractAuthenticatedUI.java | ||
---|---|---|
12 | 12 |
import eu.etaxonomy.cdm.vaadin.presenter.AuthenticationPresenter; |
13 | 13 |
import eu.etaxonomy.cdm.vaadin.view.AuthenticationView; |
14 | 14 |
|
15 |
public abstract class AbstractAuthenticatedUI extends UI { |
|
15 |
public abstract class AbstractAuthenticatedUI extends CdmBaseUI {
|
|
16 | 16 |
|
17 | 17 |
/** |
18 | 18 |
* |
... | ... | |
31 | 31 |
@Override |
32 | 32 |
protected void init(VaadinRequest request) { |
33 | 33 |
|
34 |
super.init(request); |
|
34 | 35 |
// Create a navigator to control the views |
35 | 36 |
navigator = new Navigator(this, this); |
36 | 37 |
|
src/main/java/eu/etaxonomy/cdm/vaadin/ui/CdmBaseUI.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2015 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 |
package eu.etaxonomy.cdm.vaadin.ui; |
|
11 |
|
|
12 |
import com.vaadin.server.VaadinRequest; |
|
13 |
import com.vaadin.ui.UI; |
|
14 |
|
|
15 |
import eu.etaxonomy.cdm.vaadin.session.CdmDataChangeService; |
|
16 |
import eu.etaxonomy.cdm.vaadin.util.CdmVaadinSessionUtilities; |
|
17 |
|
|
18 |
/** |
|
19 |
* @author cmathew |
|
20 |
* @date 7 Apr 2015 |
|
21 |
* |
|
22 |
*/ |
|
23 |
public class CdmBaseUI extends UI { |
|
24 |
|
|
25 |
/* (non-Javadoc) |
|
26 |
* @see com.vaadin.ui.UI#init(com.vaadin.server.VaadinRequest) |
|
27 |
*/ |
|
28 |
@Override |
|
29 |
protected void init(VaadinRequest request) { |
|
30 |
CdmVaadinSessionUtilities.setCurrentAttribute(CdmDataChangeService.KEY, new CdmDataChangeService()); |
|
31 |
} |
|
32 |
|
|
33 |
} |
Also available in: Unified diff
NewTaxonBaseComposite, INewTaxonBaseComposite, INewTaxonBaseComponentListener, NewTaxonBasePresenter : added new component for creating new taxon / synonym
CdmVaadinSessionUtilities : utility class for vaddin session
CdmVaadinUtilities : utility class for general vaadin ui
SQLUtils : utility class for cdm sql containers
CdmQueryFactory : added freeform query to mimic table query and using default id
CdmDataChangeService, CdmChangeEvent, ICdmChangeListener : service which calls registers listeners when events are fired
CdmBaseUI : base cdm ui class, currently manages the cdm data change service
AbstractAuthenticatedUI, AuthenticationView, CdmVaadinConversationalServlet : using CdmVaadinSessionUtilities to set session attributes
CdmSpringContextHelper : using vaadin connection pool and cleanup code
DistributionSelectionPresenter, DistributionTablePresenter : changes coming from update in CdmQueryFactory