1
|
/**
|
2
|
* Copyright (C) 2017 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.cdm.vaadin.view.registration;
|
10
|
|
11
|
import static eu.etaxonomy.cdm.vaadin.component.registration.RegistrationStyles.LABEL_NOWRAP;
|
12
|
|
13
|
import java.util.ArrayList;
|
14
|
import java.util.Collection;
|
15
|
import java.util.Collections;
|
16
|
import java.util.EnumSet;
|
17
|
import java.util.HashMap;
|
18
|
import java.util.Iterator;
|
19
|
import java.util.List;
|
20
|
import java.util.Map;
|
21
|
import java.util.Set;
|
22
|
import java.util.Stack;
|
23
|
import java.util.UUID;
|
24
|
|
25
|
import org.springframework.security.core.GrantedAuthority;
|
26
|
import org.vaadin.viritin.fields.LazyComboBox;
|
27
|
|
28
|
import com.vaadin.navigator.View;
|
29
|
import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent;
|
30
|
import com.vaadin.server.FontAwesome;
|
31
|
import com.vaadin.server.Page;
|
32
|
import com.vaadin.shared.ui.label.ContentMode;
|
33
|
import com.vaadin.spring.annotation.SpringView;
|
34
|
import com.vaadin.ui.Alignment;
|
35
|
import com.vaadin.ui.Button;
|
36
|
import com.vaadin.ui.CssLayout;
|
37
|
import com.vaadin.ui.GridLayout;
|
38
|
import com.vaadin.ui.HorizontalLayout;
|
39
|
import com.vaadin.ui.Label;
|
40
|
import com.vaadin.ui.Notification;
|
41
|
import com.vaadin.ui.Panel;
|
42
|
import com.vaadin.ui.UI;
|
43
|
import com.vaadin.ui.VerticalLayout;
|
44
|
import com.vaadin.ui.Window;
|
45
|
import com.vaadin.ui.themes.ValoTheme;
|
46
|
|
47
|
import eu.etaxonomy.cdm.api.service.dto.EntityReference;
|
48
|
import eu.etaxonomy.cdm.api.service.dto.RegistrationDTO;
|
49
|
import eu.etaxonomy.cdm.api.service.dto.RegistrationType;
|
50
|
import eu.etaxonomy.cdm.api.service.dto.TypedEntityReference;
|
51
|
import eu.etaxonomy.cdm.api.service.name.TypeDesignationSetManager.TypeDesignationWorkingSetType;
|
52
|
import eu.etaxonomy.cdm.model.name.Registration;
|
53
|
import eu.etaxonomy.cdm.model.name.RegistrationStatus;
|
54
|
import eu.etaxonomy.cdm.model.name.TaxonName;
|
55
|
import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
|
56
|
import eu.etaxonomy.cdm.vaadin.component.registration.RegistrationItem;
|
57
|
import eu.etaxonomy.cdm.vaadin.component.registration.RegistrationItemButtons;
|
58
|
import eu.etaxonomy.cdm.vaadin.component.registration.RegistrationItemNameAndTypeButtons;
|
59
|
import eu.etaxonomy.cdm.vaadin.component.registration.RegistrationItemNameAndTypeButtons.TypeDesignationWorkingSetButton;
|
60
|
import eu.etaxonomy.cdm.vaadin.component.registration.RegistrationItemsPanel;
|
61
|
import eu.etaxonomy.cdm.vaadin.component.registration.RegistrationStateLabel;
|
62
|
import eu.etaxonomy.cdm.vaadin.component.registration.RegistrationStyles;
|
63
|
import eu.etaxonomy.cdm.vaadin.event.AbstractEditorAction.EditorActionContext;
|
64
|
import eu.etaxonomy.cdm.vaadin.event.RegistrationEditorAction;
|
65
|
import eu.etaxonomy.cdm.vaadin.event.ShowDetailsEvent;
|
66
|
import eu.etaxonomy.cdm.vaadin.event.TaxonNameEditorAction;
|
67
|
import eu.etaxonomy.cdm.vaadin.event.TypeDesignationWorkingsetEditorAction;
|
68
|
import eu.etaxonomy.cdm.vaadin.event.registration.RegistrationWorkingsetAction;
|
69
|
import eu.etaxonomy.cdm.vaadin.model.registration.RegistrationWorkingSet;
|
70
|
import eu.etaxonomy.cdm.vaadin.permission.AccessRestrictedView;
|
71
|
import eu.etaxonomy.cdm.vaadin.permission.PermissionDebugUtils;
|
72
|
import eu.etaxonomy.cdm.vaadin.permission.UserHelper;
|
73
|
import eu.etaxonomy.cdm.vaadin.theme.EditValoTheme;
|
74
|
import eu.etaxonomy.cdm.vaadin.view.AbstractPageView;
|
75
|
import eu.etaxonomy.vaadin.event.EditorActionType;
|
76
|
|
77
|
/**
|
78
|
* @author a.kohlbecker
|
79
|
* @since Mar 2, 2017
|
80
|
*
|
81
|
*/
|
82
|
@SpringView(name=RegistrationWorksetViewBean.NAME)
|
83
|
public class RegistrationWorksetViewBean extends AbstractPageView<RegistrationWorkingsetPresenter>
|
84
|
implements RegistrationWorkingsetView, View, AccessRestrictedView {
|
85
|
|
86
|
/**
|
87
|
*
|
88
|
*/
|
89
|
private static final int COL_INDEX_STATE_LABEL = 0;
|
90
|
|
91
|
/**
|
92
|
*
|
93
|
*/
|
94
|
private static final int COL_INDEX_REG_ITEM = 1;
|
95
|
|
96
|
/**
|
97
|
*
|
98
|
*/
|
99
|
private static final int COL_INDEX_BUTTON_GROUP = 2;
|
100
|
|
101
|
public static final String DOM_ID_WORKINGSET = "workingset";
|
102
|
|
103
|
private static final long serialVersionUID = -213040114015958970L;
|
104
|
|
105
|
public static final String NAME = "workingset";
|
106
|
|
107
|
public RegistrationType regType = null;
|
108
|
|
109
|
private List<CssLayout> registrations = new ArrayList<>();
|
110
|
|
111
|
private String headerText = "Registration Workingset Editor";
|
112
|
private String subheaderText = "";
|
113
|
|
114
|
private UUID citationUuid;
|
115
|
|
116
|
private Button addNewNameRegistrationButton;
|
117
|
|
118
|
private LazyComboBox<TaxonName> existingNameCombobox;
|
119
|
|
120
|
private GridLayout registrationsGrid;
|
121
|
|
122
|
private Button addExistingNameButton;
|
123
|
|
124
|
private RegistrationItem workingsetHeader;
|
125
|
|
126
|
private Panel registrationListPanel;
|
127
|
|
128
|
/**
|
129
|
* uses the registrationId as key
|
130
|
*/
|
131
|
private Map<UUID, RegistrationDetailsItem> registrationItemMap = new HashMap<>();
|
132
|
|
133
|
/**
|
134
|
* uses the registrationId as key
|
135
|
*/
|
136
|
private Map<UUID, EntityReference> typifiedNamesMap = new HashMap<>();
|
137
|
|
138
|
public RegistrationWorksetViewBean() {
|
139
|
super();
|
140
|
}
|
141
|
|
142
|
|
143
|
/**
|
144
|
* {@inheritDoc}
|
145
|
*/
|
146
|
@Override
|
147
|
protected void initContent() {
|
148
|
getLayout().setId(NAME);
|
149
|
updateHeader();
|
150
|
// all content is added in createRegistrationsList()
|
151
|
}
|
152
|
|
153
|
|
154
|
/**
|
155
|
* {@inheritDoc}
|
156
|
*/
|
157
|
@Override
|
158
|
public void enter(ViewChangeEvent event) {
|
159
|
if(event.getParameters() != null){
|
160
|
this.citationUuid = UUID.fromString(event.getParameters());
|
161
|
|
162
|
getPresenter().handleViewEntered();
|
163
|
}
|
164
|
}
|
165
|
|
166
|
/**
|
167
|
* {@inheritDoc}
|
168
|
*/
|
169
|
@Override
|
170
|
public void setWorkingset(RegistrationWorkingSet workingset) {
|
171
|
|
172
|
if(workingsetHeader != null){
|
173
|
getLayout().removeComponent(workingsetHeader);
|
174
|
getLayout().removeComponent(registrationListPanel);
|
175
|
}
|
176
|
workingsetHeader = new RegistrationItem(workingset, this);
|
177
|
addContentComponent(workingsetHeader, null);
|
178
|
|
179
|
registrationListPanel = createRegistrationsList(workingset);
|
180
|
registrationListPanel.setHeight("100%");
|
181
|
registrationListPanel.setStyleName("registration-list");
|
182
|
registrationListPanel.setCaption("Registrations");
|
183
|
addContentComponent(registrationListPanel, 1.0f);
|
184
|
|
185
|
}
|
186
|
|
187
|
@Override
|
188
|
public void setBlockingRegistrations(UUID registrationUuid, Set<RegistrationDTO> blockingRegDTOs) {
|
189
|
|
190
|
RegistrationDetailsItem regItem = registrationItemMap.get(registrationUuid);
|
191
|
|
192
|
boolean blockingRegAdded = false;
|
193
|
for(Iterator it = regItem.itemFooter.iterator(); it.hasNext(); ){
|
194
|
if(it.next() instanceof RegistrationItemsPanel){
|
195
|
blockingRegAdded = true;
|
196
|
break;
|
197
|
}
|
198
|
}
|
199
|
if(!blockingRegAdded){
|
200
|
regItem.itemFooter.addComponent(new RegistrationItemsPanel(this, "Blocked by", blockingRegDTOs));
|
201
|
}
|
202
|
}
|
203
|
|
204
|
/**
|
205
|
* {@inheritDoc}
|
206
|
*/
|
207
|
@Override
|
208
|
@Deprecated // no longer needed
|
209
|
public void addBlockingRegistration(RegistrationDTO blocking) {
|
210
|
if(registrations == null) {
|
211
|
throw new RuntimeException("A Workingset must be present prior adding blocking registrations.");
|
212
|
}
|
213
|
// add the blocking registration
|
214
|
|
215
|
}
|
216
|
|
217
|
/**
|
218
|
* @param workingset
|
219
|
* @return
|
220
|
*/
|
221
|
public Panel createRegistrationsList(RegistrationWorkingSet workingset) {
|
222
|
|
223
|
registrationsGrid = new GridLayout(3, 1);
|
224
|
registrationsGrid.setWidth("100%");
|
225
|
// allow vertical scrolling:
|
226
|
registrationsGrid.setHeightUndefined();
|
227
|
|
228
|
//registrationsGrid.setColumnExpandRatio(0, 0.1f);
|
229
|
registrationsGrid.setColumnExpandRatio(1, 1f);
|
230
|
|
231
|
registrationItemMap.clear();
|
232
|
registrationsGrid.setRows(workingset.getRegistrationDTOs().size() * 2 + 2);
|
233
|
int row = 0;
|
234
|
for(RegistrationDTO dto : workingset.getRegistrationDTOs()) {
|
235
|
row = putRegistrationListComponent(row, dto);
|
236
|
}
|
237
|
|
238
|
Label addRegistrationLabel_1 = new Label("Add a new registration for a");
|
239
|
Label addRegistrationLabel_2 = new Label("or an");
|
240
|
|
241
|
addNewNameRegistrationButton = new Button("new name");
|
242
|
addNewNameRegistrationButton.setDescription("A name which is newly published in this publication.");
|
243
|
addNewNameRegistrationButton.addClickListener(
|
244
|
e -> getViewEventBus().publish(this, new TaxonNameEditorAction(EditorActionType.ADD, null, addNewNameRegistrationButton, null, this)));
|
245
|
|
246
|
addExistingNameButton = new Button("existing name:");
|
247
|
addExistingNameButton.setDescription("A name which was previously published in a earlier publication.");
|
248
|
addExistingNameButton.setEnabled(false);
|
249
|
addExistingNameButton.addClickListener(
|
250
|
e -> getViewEventBus().publish(this, new RegistrationWorkingsetAction(citationUuid, RegistrationWorkingsetAction.Action.start))
|
251
|
);
|
252
|
|
253
|
existingNameCombobox = new LazyComboBox<TaxonName>(TaxonName.class);
|
254
|
existingNameCombobox.addValueChangeListener(
|
255
|
e -> addExistingNameButton.setEnabled(e.getProperty().getValue() != null)
|
256
|
);
|
257
|
|
258
|
HorizontalLayout buttonContainer = new HorizontalLayout(addRegistrationLabel_1, addNewNameRegistrationButton, addRegistrationLabel_2, addExistingNameButton, existingNameCombobox);
|
259
|
buttonContainer.setSpacing(true);
|
260
|
// buttonContainer.setWidth(100, Unit.PERCENTAGE);
|
261
|
buttonContainer.setComponentAlignment(addRegistrationLabel_1, Alignment.MIDDLE_LEFT);
|
262
|
buttonContainer.setComponentAlignment(addRegistrationLabel_2, Alignment.MIDDLE_LEFT);
|
263
|
|
264
|
row++;
|
265
|
registrationsGrid.addComponent(buttonContainer, 0, row, COL_INDEX_BUTTON_GROUP, row);
|
266
|
registrationsGrid.setComponentAlignment(buttonContainer, Alignment.MIDDLE_RIGHT);
|
267
|
|
268
|
Panel namesTypesPanel = new Panel(registrationsGrid);
|
269
|
namesTypesPanel.setStyleName(EditValoTheme.PANEL_CONTENT_PADDING_LEFT);
|
270
|
return namesTypesPanel;
|
271
|
}
|
272
|
|
273
|
|
274
|
|
275
|
protected int putRegistrationListComponent(int row, RegistrationDTO dto) {
|
276
|
|
277
|
EntityReference typifiedNameReference = dto.getTypifiedNameRef();
|
278
|
if(typifiedNameReference == null){
|
279
|
typifiedNameReference = dto.getNameRef();
|
280
|
}
|
281
|
typifiedNamesMap.put(dto.getUuid(), typifiedNameReference);
|
282
|
|
283
|
RegistrationItemNameAndTypeButtons regItemButtonGroup = new RegistrationItemNameAndTypeButtons(dto);
|
284
|
UUID registrationEntityUuid = dto.getUuid();
|
285
|
|
286
|
RegistrationItemButtons regItemButtons = new RegistrationItemButtons();
|
287
|
|
288
|
CssLayout footer = new CssLayout();
|
289
|
footer.setWidth(100, Unit.PERCENTAGE);
|
290
|
footer.setStyleName("item-footer");
|
291
|
|
292
|
RegistrationDetailsItem regDetailsItem = new RegistrationDetailsItem(regItemButtonGroup, regItemButtons, footer);
|
293
|
registrationItemMap.put(registrationEntityUuid, regDetailsItem);
|
294
|
|
295
|
Stack<EditorActionContext> context = new Stack<EditorActionContext>();
|
296
|
context.push(new EditorActionContext(
|
297
|
new TypedEntityReference<>(Registration.class, registrationEntityUuid),
|
298
|
this)
|
299
|
);
|
300
|
|
301
|
if(regItemButtonGroup.getNameButton() != null){
|
302
|
regItemButtonGroup.getNameButton().getButton().addClickListener(e -> {
|
303
|
UUID nameuUuid = regItemButtonGroup.getNameButton().getUuid();
|
304
|
getViewEventBus().publish(this, new TaxonNameEditorAction(
|
305
|
EditorActionType.EDIT,
|
306
|
nameuUuid,
|
307
|
e.getButton(),
|
308
|
null,
|
309
|
this,
|
310
|
context
|
311
|
)
|
312
|
);
|
313
|
});
|
314
|
}
|
315
|
|
316
|
for(TypeDesignationWorkingSetButton workingsetButton : regItemButtonGroup.getTypeDesignationButtons()){
|
317
|
workingsetButton.getButton().addClickListener(e -> {
|
318
|
TypedEntityReference baseEntityRef = workingsetButton.getBaseEntity();
|
319
|
EntityReference typifiedNameRef = typifiedNamesMap.get(registrationEntityUuid);
|
320
|
TypeDesignationWorkingSetType workingsetType = workingsetButton.getType();
|
321
|
getViewEventBus().publish(this, new TypeDesignationWorkingsetEditorAction(
|
322
|
EditorActionType.EDIT,
|
323
|
baseEntityRef,
|
324
|
workingsetType,
|
325
|
registrationEntityUuid,
|
326
|
typifiedNameRef.getUuid(),
|
327
|
e.getButton(),
|
328
|
null,
|
329
|
this,
|
330
|
context
|
331
|
)
|
332
|
);
|
333
|
});
|
334
|
}
|
335
|
|
336
|
regItemButtonGroup.getAddTypeDesignationButton().addClickListener(
|
337
|
e -> chooseNewTypeRegistrationWorkingset(dto.getUuid())
|
338
|
);
|
339
|
|
340
|
|
341
|
Button blockingRegistrationButton = regItemButtons.getBlockingRegistrationButton();
|
342
|
blockingRegistrationButton.setStyleName(ValoTheme.BUTTON_TINY);
|
343
|
blockingRegistrationButton.setDescription("No blocking registrations");
|
344
|
if(dto.isBlocked()){
|
345
|
blockingRegistrationButton.setEnabled(true);
|
346
|
blockingRegistrationButton.setDescription("This registration is currently blocked by other registrations");
|
347
|
blockingRegistrationButton.addStyleName(EditValoTheme.BUTTON_HIGHLITE);
|
348
|
blockingRegistrationButton.addClickListener(e -> getViewEventBus().publish(
|
349
|
this,
|
350
|
new ShowDetailsEvent<RegistrationDTO, UUID>(
|
351
|
e,
|
352
|
RegistrationDTO.class,
|
353
|
dto.getUuid(),
|
354
|
RegistrationItem.BLOCKED_BY
|
355
|
)
|
356
|
));
|
357
|
}
|
358
|
|
359
|
Button validationProblemsButton = regItemButtons.getValidationProblemsButton();
|
360
|
validationProblemsButton.setStyleName(ValoTheme.BUTTON_TINY); // + " " + RegistrationStyles.STYLE_FRIENDLY_FOREGROUND);
|
361
|
|
362
|
if(!dto.getValidationProblems().isEmpty()){
|
363
|
validationProblemsButton.setEnabled(true);
|
364
|
validationProblemsButton.addClickListener(e -> getViewEventBus().publish(this,
|
365
|
new ShowDetailsEvent<RegistrationDTO, UUID>(
|
366
|
e,
|
367
|
RegistrationDTO.class,
|
368
|
dto.getUuid(),
|
369
|
RegistrationItem.VALIDATION_PROBLEMS
|
370
|
)
|
371
|
)
|
372
|
);
|
373
|
}
|
374
|
validationProblemsButton.setCaption("<span class=\"" + RegistrationStyles.BUTTON_BADGE +"\"> " + dto.getValidationProblems().size() + "</span>");
|
375
|
validationProblemsButton.setCaptionAsHtml(true);
|
376
|
|
377
|
Button messageButton = regItemButtons.getMessagesButton();
|
378
|
messageButton.addClickListener(e -> getViewEventBus().publish(this,
|
379
|
new ShowDetailsEvent<RegistrationDTO, UUID>(
|
380
|
e,
|
381
|
RegistrationDTO.class,
|
382
|
dto.getUuid(),
|
383
|
RegistrationItem.MESSAGES
|
384
|
)
|
385
|
)
|
386
|
);
|
387
|
messageButton.setStyleName(ValoTheme.BUTTON_TINY);
|
388
|
|
389
|
RegistrationStateLabel stateLabel = new RegistrationStateLabel().update(dto.getStatus());
|
390
|
Label submitterLabel = new Label(dto.getSubmitterUserName());
|
391
|
submitterLabel.setStyleName(LABEL_NOWRAP + " submitter");
|
392
|
submitterLabel.setIcon(FontAwesome.USER);
|
393
|
submitterLabel.setContentMode(ContentMode.HTML);
|
394
|
CssLayout stateAndSubmitter = new CssLayout(stateLabel, submitterLabel);
|
395
|
|
396
|
|
397
|
if(UserHelper.fromSession().userIsRegistrationCurator() || UserHelper.fromSession().userIsAdmin()) {
|
398
|
Button editRegistrationButton = new Button(FontAwesome.COG);
|
399
|
editRegistrationButton.setStyleName(ValoTheme.BUTTON_TINY);
|
400
|
editRegistrationButton.setDescription("Edit registration");
|
401
|
editRegistrationButton.addClickListener(e -> getViewEventBus().publish(this, new RegistrationEditorAction(
|
402
|
EditorActionType.EDIT,
|
403
|
dto.getUuid(),
|
404
|
e.getButton(),
|
405
|
null,
|
406
|
this
|
407
|
)));
|
408
|
regItemButtons.addComponent(editRegistrationButton);
|
409
|
}
|
410
|
|
411
|
PermissionDebugUtils.addGainPerEntityPermissionButton(regItemButtons, Registration.class, dto.getUuid(),
|
412
|
EnumSet.of(CRUD.UPDATE), RegistrationStatus.PREPARATION.name());
|
413
|
|
414
|
row++;
|
415
|
registrationsGrid.addComponent(stateAndSubmitter, COL_INDEX_STATE_LABEL, row);
|
416
|
// registrationsGrid.setComponentAlignment(stateLabel, Alignment.TOP_LEFT);
|
417
|
registrationsGrid.addComponent(regItemButtonGroup, COL_INDEX_REG_ITEM, row);
|
418
|
registrationsGrid.addComponent(regItemButtons, COL_INDEX_BUTTON_GROUP, row);
|
419
|
registrationsGrid.setComponentAlignment(regItemButtons, Alignment.TOP_LEFT);
|
420
|
|
421
|
row++;
|
422
|
registrationsGrid.addComponent(footer, 0, row, COL_INDEX_BUTTON_GROUP, row);
|
423
|
|
424
|
return row;
|
425
|
}
|
426
|
|
427
|
/**
|
428
|
* @param button
|
429
|
* @param registrationEntityId
|
430
|
*
|
431
|
*/
|
432
|
@Override
|
433
|
public void chooseNewTypeRegistrationWorkingset(UUID registrationEntityUuid){
|
434
|
Window typeDesignationTypeCooser = new Window();
|
435
|
typeDesignationTypeCooser.setModal(true);
|
436
|
typeDesignationTypeCooser.setResizable(false);
|
437
|
typeDesignationTypeCooser.setCaption("Add new type designation");
|
438
|
Label label = new Label("Please select kind of type designation to be created.");
|
439
|
Button newSpecimenTypeDesignationButton = new Button("Specimen type designation",
|
440
|
e -> addNewTypeDesignationWorkingset(TypeDesignationWorkingSetType.SPECIMEN_TYPE_DESIGNATION_WORKINGSET, registrationEntityUuid, typeDesignationTypeCooser, e.getButton()));
|
441
|
Button newNameTypeDesignationButton = new Button("Name type designation",
|
442
|
e -> addNewTypeDesignationWorkingset(TypeDesignationWorkingSetType.NAME_TYPE_DESIGNATION_WORKINGSET, registrationEntityUuid, typeDesignationTypeCooser, e.getButton()));
|
443
|
|
444
|
VerticalLayout layout = new VerticalLayout(label, newSpecimenTypeDesignationButton, newNameTypeDesignationButton);
|
445
|
layout.setMargin(true);
|
446
|
layout.setSpacing(true);
|
447
|
layout.setComponentAlignment(newSpecimenTypeDesignationButton, Alignment.MIDDLE_CENTER);
|
448
|
layout.setComponentAlignment(newNameTypeDesignationButton, Alignment.MIDDLE_CENTER);
|
449
|
typeDesignationTypeCooser.setContent(layout);
|
450
|
UI.getCurrent().addWindow(typeDesignationTypeCooser);
|
451
|
}
|
452
|
|
453
|
/**
|
454
|
* @param button
|
455
|
*
|
456
|
*/
|
457
|
protected void addNewTypeDesignationWorkingset(TypeDesignationWorkingSetType newWorkingsetType, UUID registrationEntityUuid, Window typeDesignationTypeCooser, Button sourceButton) {
|
458
|
UI.getCurrent().removeWindow(typeDesignationTypeCooser);
|
459
|
EntityReference typifiedNameRef = typifiedNamesMap.get(registrationEntityUuid);
|
460
|
getViewEventBus().publish(this, new TypeDesignationWorkingsetEditorAction(
|
461
|
EditorActionType.ADD,
|
462
|
newWorkingsetType,
|
463
|
registrationEntityUuid,
|
464
|
typifiedNameRef.getUuid(),
|
465
|
sourceButton,
|
466
|
null,
|
467
|
this
|
468
|
));
|
469
|
}
|
470
|
|
471
|
/**
|
472
|
* {@inheritDoc}
|
473
|
*/
|
474
|
@Override
|
475
|
public void openReferenceEditor(UUID referenceUuid) {
|
476
|
// TODO Auto-generated method stub
|
477
|
|
478
|
}
|
479
|
|
480
|
/**
|
481
|
* {@inheritDoc}
|
482
|
*/
|
483
|
@Override
|
484
|
public void openNameEditor(UUID nameUuid) {
|
485
|
// TODO Auto-generated method stub
|
486
|
|
487
|
}
|
488
|
|
489
|
/**
|
490
|
* {@inheritDoc}
|
491
|
*/
|
492
|
@Override
|
493
|
protected String getHeaderText() {
|
494
|
return headerText;
|
495
|
}
|
496
|
|
497
|
/**
|
498
|
* {@inheritDoc}
|
499
|
*/
|
500
|
@Override
|
501
|
public void setHeaderText(String text) {
|
502
|
this.headerText = text;
|
503
|
updateHeader();
|
504
|
|
505
|
}
|
506
|
|
507
|
/**
|
508
|
* @return the subheaderText
|
509
|
*/
|
510
|
public String getSubheaderText() {
|
511
|
return subheaderText;
|
512
|
}
|
513
|
|
514
|
/**
|
515
|
* {@inheritDoc}
|
516
|
*/
|
517
|
@Override
|
518
|
public void setSubheaderText(String text) {
|
519
|
subheaderText = text;
|
520
|
updateHeader();
|
521
|
}
|
522
|
|
523
|
/**
|
524
|
* {@inheritDoc}
|
525
|
*/
|
526
|
@Override
|
527
|
protected String getSubHeaderText() {
|
528
|
return subheaderText;
|
529
|
}
|
530
|
|
531
|
/**
|
532
|
* {@inheritDoc}
|
533
|
*/
|
534
|
@Override
|
535
|
public void openDetailsPopup(String caption, List<String> messages) {
|
536
|
StringBuffer sb = new StringBuffer();
|
537
|
sb.append("<div class=\"details-popup-content\">");
|
538
|
messages.forEach(s -> sb.append(s).append("</br>"));
|
539
|
sb.append("</div>");
|
540
|
new Notification(caption, sb.toString(), Notification.Type.HUMANIZED_MESSAGE, true).show(Page.getCurrent());
|
541
|
}
|
542
|
|
543
|
/**
|
544
|
* {@inheritDoc}
|
545
|
*/
|
546
|
@Override
|
547
|
public boolean allowAnonymousAccess() {
|
548
|
return false;
|
549
|
}
|
550
|
|
551
|
/**
|
552
|
* {@inheritDoc}
|
553
|
*/
|
554
|
@Override
|
555
|
public Collection<Collection<GrantedAuthority>> allowedGrantedAuthorities() {
|
556
|
return null;
|
557
|
}
|
558
|
|
559
|
/**
|
560
|
* @return the addNewNameRegistrationButton
|
561
|
*/
|
562
|
@Override
|
563
|
public Button getAddNewNameRegistrationButton() {
|
564
|
return addNewNameRegistrationButton;
|
565
|
}
|
566
|
|
567
|
@Override
|
568
|
public Button getAddExistingNameRegistrationButton() {
|
569
|
return addExistingNameButton;
|
570
|
}
|
571
|
|
572
|
@Override
|
573
|
public LazyComboBox<TaxonName> getAddExistingNameCombobox() {
|
574
|
return existingNameCombobox;
|
575
|
}
|
576
|
|
577
|
/**
|
578
|
* @return the citationID
|
579
|
*/
|
580
|
@Override
|
581
|
public UUID getCitationUuid() {
|
582
|
return citationUuid;
|
583
|
}
|
584
|
|
585
|
@Override
|
586
|
public Map<UUID, RegistrationDetailsItem> getRegistrationItemMap(){
|
587
|
return Collections.unmodifiableMap(registrationItemMap);
|
588
|
}
|
589
|
|
590
|
|
591
|
}
|