cleanup
[cdm-vaadin.git] / src / main / java / eu / etaxonomy / cdm / vaadin / view / registration / RegistrationWorksetViewBean.java
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.Component;
37 import com.vaadin.ui.CssLayout;
38 import com.vaadin.ui.GridLayout;
39 import com.vaadin.ui.HorizontalLayout;
40 import com.vaadin.ui.Label;
41 import com.vaadin.ui.Notification;
42 import com.vaadin.ui.Panel;
43 import com.vaadin.ui.UI;
44 import com.vaadin.ui.VerticalLayout;
45 import com.vaadin.ui.Window;
46 import com.vaadin.ui.themes.ValoTheme;
47
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.RegistrationWorkingSet;
51 import eu.etaxonomy.cdm.api.service.name.TypeDesignationSet.TypeDesignationSetType;
52 import eu.etaxonomy.cdm.api.util.RoleProberImpl;
53 import eu.etaxonomy.cdm.model.common.VersionableEntity;
54 import eu.etaxonomy.cdm.model.name.Registration;
55 import eu.etaxonomy.cdm.model.name.RegistrationStatus;
56 import eu.etaxonomy.cdm.model.name.TaxonName;
57 import eu.etaxonomy.cdm.model.permission.CRUD;
58 import eu.etaxonomy.cdm.ref.EntityReference;
59 import eu.etaxonomy.cdm.ref.TypedEntityReference;
60 import eu.etaxonomy.cdm.service.UserHelperAccess;
61 import eu.etaxonomy.cdm.vaadin.component.BadgeButton;
62 import eu.etaxonomy.cdm.vaadin.component.registration.RegistrationItem;
63 import eu.etaxonomy.cdm.vaadin.component.registration.RegistrationItemButtons;
64 import eu.etaxonomy.cdm.vaadin.component.registration.RegistrationItemNameAndTypeButtons;
65 import eu.etaxonomy.cdm.vaadin.component.registration.RegistrationItemNameAndTypeButtons.TypeDesignationSetButton;
66 import eu.etaxonomy.cdm.vaadin.component.registration.RegistrationItemsPanel;
67 import eu.etaxonomy.cdm.vaadin.component.registration.RegistrationStatusFieldInstantiator;
68 import eu.etaxonomy.cdm.vaadin.component.registration.RegistrationStatusLabel;
69 import eu.etaxonomy.cdm.vaadin.event.EditorActionContext;
70 import eu.etaxonomy.cdm.vaadin.event.RegistrationEditorAction;
71 import eu.etaxonomy.cdm.vaadin.event.ShowDetailsEvent;
72 import eu.etaxonomy.cdm.vaadin.event.TaxonNameEditorAction;
73 import eu.etaxonomy.cdm.vaadin.event.TypeDesignationSetEditorAction;
74 import eu.etaxonomy.cdm.vaadin.event.registration.RegistrationWorkingsetAction;
75 import eu.etaxonomy.cdm.vaadin.permission.AccessRestrictedView;
76 import eu.etaxonomy.cdm.vaadin.permission.PermissionDebugUtils;
77 import eu.etaxonomy.cdm.vaadin.permission.RolesAndPermissions;
78 import eu.etaxonomy.cdm.vaadin.theme.EditValoTheme;
79 import eu.etaxonomy.cdm.vaadin.view.AbstractPageView;
80 import eu.etaxonomy.vaadin.event.EditorActionType;
81
82 /**
83 * @author a.kohlbecker
84 * @since Mar 2, 2017
85 */
86 @SpringView(name=RegistrationWorksetViewBean.NAME)
87 public class RegistrationWorksetViewBean
88 extends AbstractPageView<RegistrationWorkingsetPresenter>
89 implements RegistrationWorkingsetView, View, AccessRestrictedView {
90
91 private static final long serialVersionUID = -213040114015958970L;
92
93 private static final int COL_INDEX_STATE_LABEL = 0;
94
95 private static final int COL_INDEX_REG_ITEM = 1;
96
97 private static final int COL_INDEX_BUTTON_GROUP = 2;
98
99 public static final String DOM_ID_WORKINGSET = "workingset";
100
101 public static final String TEXT_NAME_TYPIFICATION = "covering the name and typifications";
102 public static final String TEXT_TYPIFICATION_ONLY = "covering typifications only";
103
104 public static final String NAME = "workingset";
105
106 private List<CssLayout> registrations = new ArrayList<>();
107
108 private String headerText = "Registration Workingset Editor";
109 private String subheaderText = "";
110
111 private UUID citationUuid;
112
113 private GridLayout registrationsGrid;
114
115 private RegistrationItem workingsetHeader;
116
117 private Panel registrationListPanel;
118
119 private Button addNewNameRegistrationButton;
120
121 private Button addExistingNameButton;
122
123 private LazyComboBox<TaxonName> existingNameCombobox;
124
125 private Label existingNameRegistrationTypeLabel;
126
127 /**
128 * uses the registrationId as key
129 */
130 private Map<UUID, RegistrationDetailsItem> registrationItemMap = new HashMap<>();
131
132 /**
133 * uses the registrationId as key
134 */
135 private Map<UUID, EntityReference> typifiedNamesMap = new HashMap<>();
136
137 private RegistrationStatusFieldInstantiator statusFieldInstantiator;
138
139 private String accessDeniedMessage;
140
141 private Object existingNameEditor;
142
143 public RegistrationWorksetViewBean() {
144 super();
145 }
146
147 @Override
148 protected void initContent() {
149 getLayout().setId(NAME);
150 updateHeader();
151 // all content is added in createRegistrationsList()
152 }
153
154 @Override
155 public void enter(ViewChangeEvent event) {
156 if(event.getParameters() != null){
157 this.citationUuid = UUID.fromString(event.getParameters());
158
159 getPresenter().handleViewEntered();
160 }
161 }
162
163 @Override
164 public void setWorkingset(RegistrationWorkingSet workingset) {
165
166 if(workingsetHeader != null){
167 getLayout().removeComponent(workingsetHeader);
168 getLayout().removeComponent(registrationListPanel);
169 }
170 workingsetHeader = new RegistrationItem(workingset, this, getPresenter().getCache());
171 addContentComponent(workingsetHeader, null);
172
173 registrationListPanel = createRegistrationsList(workingset);
174 registrationListPanel.setHeight("100%");
175 registrationListPanel.setStyleName("registration-list");
176 registrationListPanel.setCaption("Registrations");
177 addContentComponent(registrationListPanel, 1.0f);
178 }
179
180 @Override
181 public void setBlockingRegistrations(UUID registrationUuid, Set<RegistrationDTO> blockingRegDTOs) {
182
183 RegistrationDetailsItem regItem = registrationItemMap.get(registrationUuid);
184
185 boolean blockingRegAdded = false;
186 for(Iterator it = regItem.itemFooter.iterator(); it.hasNext(); ){
187 if(it.next() instanceof RegistrationItemsPanel){
188 blockingRegAdded = true;
189 break;
190 }
191 }
192 if(!blockingRegAdded){
193 regItem.itemFooter.addComponent(new RegistrationItemsPanel(this, "Blocked by", blockingRegDTOs, getPresenter().getCache()));
194 }
195 }
196
197 @Override
198 @Deprecated // no longer needed
199 public void addBlockingRegistration(RegistrationDTO blocking) {
200 if(registrations == null) {
201 throw new RuntimeException("A Workingset must be present prior adding blocking registrations.");
202 }
203 // add the blocking registration
204
205 }
206
207 public Panel createRegistrationsList(RegistrationWorkingSet workingset) {
208
209 registrationsGrid = new GridLayout(3, 1);
210 registrationsGrid.setWidth("100%");
211 // allow vertical scrolling:
212 registrationsGrid.setHeightUndefined();
213
214 //registrationsGrid.setColumnExpandRatio(0, 0.1f);
215 registrationsGrid.setColumnExpandRatio(1, 1f);
216
217 registrationItemMap.clear();
218 registrationsGrid.setRows(workingset.getRegistrationDTOs().size() * 2 + 3);
219 int row = 0;
220 for(RegistrationDTO dto : workingset.getRegistrationDTOs()) {
221 row = putRegistrationListComponent(row, dto);
222 }
223
224 // --- Footer with UI to create new registrations ----
225 Label addRegistrationLabel_1 = new Label("Add a new registration for a");
226 Label addRegistrationLabel_2 = new Label("or an");
227
228 addNewNameRegistrationButton = new Button("new name");
229 addNewNameRegistrationButton.setDescription("A name which is newly published in this publication.");
230 Stack<EditorActionContext> context = new Stack<EditorActionContext>();
231 context.push(new EditorActionContext(
232 new TypedEntityReference<>(Registration.class, null),
233 this)
234 );
235 addNewNameRegistrationButton.addClickListener(
236 e -> {
237 getViewEventBus().publish(this, new TaxonNameEditorAction(EditorActionType.ADD, null, addNewNameRegistrationButton, null, this, context));
238
239 }
240 );
241
242 existingNameRegistrationTypeLabel = new Label();
243 addExistingNameButton = new Button("existing name:");
244 addExistingNameButton.setEnabled(false);
245 addExistingNameButton.addClickListener(e -> reviewExistingName());
246
247 existingNameCombobox = new LazyComboBox<TaxonName>(TaxonName.class);
248 existingNameCombobox.addValueChangeListener(
249 e -> {
250 boolean selectionNotEmpty = e.getProperty().getValue() != null;
251 addExistingNameButton.setEnabled(false);
252 existingNameRegistrationTypeLabel.setValue(null);
253 if(selectionNotEmpty){
254 TaxonName name = (TaxonName)e.getProperty().getValue();
255 if(getPresenter().canCreateNameRegistrationFor(name)){
256 existingNameRegistrationTypeLabel.setValue(TEXT_NAME_TYPIFICATION);
257 addExistingNameButton.setEnabled(true);
258 } else {
259 if(!getPresenter().checkWokingsetContainsProtologe(name)){
260 existingNameRegistrationTypeLabel.setValue(TEXT_TYPIFICATION_ONLY);
261 addExistingNameButton.setEnabled(true);
262 }
263 }
264 } else {
265 existingNameRegistrationTypeLabel.setValue(null);
266 }
267 }
268 );
269
270 HorizontalLayout buttonContainer = new HorizontalLayout(
271 addRegistrationLabel_1,
272 addNewNameRegistrationButton,
273 addRegistrationLabel_2,
274 addExistingNameButton,
275 existingNameCombobox,
276 existingNameRegistrationTypeLabel
277 );
278 buttonContainer.setSpacing(true);
279 // buttonContainer.setWidth(100, Unit.PERCENTAGE);
280 buttonContainer.setComponentAlignment(addRegistrationLabel_1, Alignment.MIDDLE_LEFT);
281 buttonContainer.setComponentAlignment(addRegistrationLabel_2, Alignment.MIDDLE_LEFT);
282
283 row++;
284 registrationsGrid.addComponent(buttonContainer, 0, row, COL_INDEX_BUTTON_GROUP, row);
285 registrationsGrid.setComponentAlignment(buttonContainer, Alignment.MIDDLE_RIGHT);
286
287 row++;
288 Label hint = new Label(
289 "For most names that already exist in the system, it is only possible to create a registration covering type designations. "
290 + "In all other cases please choose <a href=\"registration#!regStart\">\"New\"</a> from the main menu and start a registration for the nomenclatural reference of the name to be registered.",
291 ContentMode.HTML);
292 registrationsGrid.addComponent(hint, 0, row, COL_INDEX_BUTTON_GROUP, row);
293 registrationsGrid.setComponentAlignment(hint, Alignment.MIDDLE_RIGHT);
294
295 Panel namesTypesPanel = new Panel(registrationsGrid);
296 namesTypesPanel.setStyleName(EditValoTheme.PANEL_CONTENT_PADDING_LEFT);
297 return namesTypesPanel;
298 }
299
300 private void reviewExistingName() {
301 // call commit to make the selection available
302 existingNameCombobox.commit();
303 UUID uuid = existingNameCombobox.getValue().getUuid();
304 Stack<EditorActionContext> context = new Stack<EditorActionContext>();
305 context.push(new EditorActionContext(
306 new TypedEntityReference<>(TaxonName.class, uuid),
307 this)
308 );
309 getViewEventBus().publish(
310 this,
311 new TaxonNameEditorAction(
312 EditorActionType.EDIT,
313 uuid,
314 addExistingNameButton,
315 existingNameCombobox,
316 this,
317 context)
318 );
319
320 }
321
322 /**
323 * publishes an event to the {@link RegistrationWorkingsetPresenter}
324 * @deprecated no longer used but kept for reference
325 * TODO remove for version 5.8 when not used again.
326 */
327 @Deprecated
328 private void triggerRegistrationForExistingName() {
329 getViewEventBus().publish(this, new RegistrationWorkingsetAction(
330 citationUuid,
331 RegistrationWorkingsetAction.Action.start
332 )
333 );
334 }
335
336 protected int putRegistrationListComponent(int row, RegistrationDTO dto) {
337
338 EntityReference typifiedNameReference = dto.getTypifiedNameRef();
339 if(typifiedNameReference == null){
340 typifiedNameReference = dto.getNameRef();
341 }
342 typifiedNamesMap.put(dto.getUuid(), typifiedNameReference);
343
344 RegistrationItemNameAndTypeButtons regItemButtonGroup = new RegistrationItemNameAndTypeButtons(dto, getPresenter().getCache());
345 UUID registrationEntityUuid = dto.getUuid();
346
347 RegistrationItemButtons regItemButtons = new RegistrationItemButtons();
348
349 CssLayout footer = new CssLayout();
350 footer.setWidth(100, Unit.PERCENTAGE);
351 footer.setStyleName("item-footer");
352
353 RegistrationDetailsItem regDetailsItem = new RegistrationDetailsItem(regItemButtonGroup, regItemButtons, footer);
354 registrationItemMap.put(registrationEntityUuid, regDetailsItem);
355
356 Stack<EditorActionContext> context = new Stack<EditorActionContext>();
357 context.push(new EditorActionContext(
358 new TypedEntityReference<>(Registration.class, registrationEntityUuid),
359 this)
360 );
361
362 if(regItemButtonGroup.getNameButton() != null){
363 regItemButtonGroup.getNameButton().getButton().addClickListener(e -> {
364 UUID nameuUuid = regItemButtonGroup.getNameButton().getUuid();
365 getViewEventBus().publish(this, new TaxonNameEditorAction(
366 EditorActionType.EDIT,
367 nameuUuid,
368 e.getButton(),
369 null,
370 this,
371 context
372 )
373 );
374 });
375 }
376
377 for(TypeDesignationSetButton workingsetButton : regItemButtonGroup.getTypeDesignationButtons()){
378 workingsetButton.getButton().addClickListener(e -> {
379 VersionableEntity baseEntity = workingsetButton.getBaseEntity();
380 EntityReference typifiedNameRef = typifiedNamesMap.get(registrationEntityUuid);
381 TypeDesignationSetType workingsetType = workingsetButton.getType();
382 getViewEventBus().publish(this, new TypeDesignationSetEditorAction(
383 baseEntity,
384 workingsetType,
385 registrationEntityUuid,
386 typifiedNameRef.getUuid(),
387 e.getButton(),
388 null,
389 this,
390 context
391 )
392 );
393 });
394 }
395
396 regItemButtonGroup.getAddTypeDesignationButton().addClickListener(
397 e -> chooseNewTypeRegistrationWorkingset(dto.getUuid())
398 );
399
400 Button blockingRegistrationButton = regItemButtons.getBlockingRegistrationButton();
401 blockingRegistrationButton.setStyleName(ValoTheme.BUTTON_TINY);
402 blockingRegistrationButton.setDescription("No blocking registrations");
403 if(dto.isBlocked()){
404 blockingRegistrationButton.setEnabled(true);
405 blockingRegistrationButton.setDescription("This registration is currently blocked by other registrations");
406 blockingRegistrationButton.addStyleName(EditValoTheme.BUTTON_HIGHLITE);
407 blockingRegistrationButton.addClickListener(e -> getViewEventBus().publish(
408 this,
409 new ShowDetailsEvent<RegistrationDTO, UUID>(
410 e,
411 RegistrationDTO.class,
412 dto.getUuid(),
413 RegistrationItem.BLOCKED_BY
414 )
415 ));
416 }
417
418 BadgeButton validationProblemsButton = regItemButtons.getValidationProblemsButton();
419 validationProblemsButton.setStyleName(ValoTheme.BUTTON_TINY); // + " " + RegistrationStyles.STYLE_FRIENDLY_FOREGROUND);
420
421 if(!dto.getValidationProblems().isEmpty()){
422 validationProblemsButton.setEnabled(true);
423 validationProblemsButton.addClickListener(e -> getViewEventBus().publish(this,
424 new ShowDetailsEvent<RegistrationDTO, UUID>(
425 e,
426 RegistrationDTO.class,
427 dto.getUuid(),
428 RegistrationItem.VALIDATION_PROBLEMS
429 )
430 )
431 );
432 }
433 int problemCount = dto.getValidationProblems().size();
434 validationProblemsButton.setCaption(problemCount > 0 ? Integer.toString(problemCount) : null);
435
436 Component statusComponent;
437 if(statusFieldInstantiator != null){
438 statusComponent = statusFieldInstantiator.create(dto);
439 } else {
440 statusComponent = new RegistrationStatusLabel().update(dto.getStatus());
441 }
442 Label submitterLabel = new Label(dto.getSubmitterUserName());
443 submitterLabel.setStyleName(LABEL_NOWRAP + " submitter");
444 submitterLabel.setIcon(FontAwesome.USER);
445 submitterLabel.setContentMode(ContentMode.HTML);
446 CssLayout stateAndSubmitter = new CssLayout(statusComponent, submitterLabel);
447
448
449 if(UserHelperAccess.userHelper().userIs(new RoleProberImpl(RolesAndPermissions.ROLE_CURATION)) || UserHelperAccess.userHelper().userIsAdmin()) {
450
451 Button editRegistrationButton = new Button(FontAwesome.COG);
452 editRegistrationButton.setStyleName(ValoTheme.BUTTON_TINY);
453 editRegistrationButton.setDescription("Edit registration");
454 editRegistrationButton.addClickListener(e -> getViewEventBus().publish(this, new RegistrationEditorAction(
455 EditorActionType.EDIT,
456 dto.getUuid(),
457 e.getButton(),
458 null,
459 this
460 )));
461
462 Button unlockButton = new Button(FontAwesome.LOCK);
463 unlockButton.setStyleName(ValoTheme.BUTTON_TINY);
464 unlockButton.setDescription("Unlock");
465 unlockButton.addClickListener(e -> {
466 regItemButtonGroup.setLockOverride(!regItemButtonGroup.isLockOverride());
467 if(regItemButtonGroup.isRegistrationLocked()){
468 unlockButton.setIcon(regItemButtonGroup.isLockOverride() ? FontAwesome.UNLOCK_ALT : FontAwesome.LOCK);
469 unlockButton.setDescription(regItemButtonGroup.isLockOverride() ? "Click to unlock editing" : "Click to lock editing");
470 }
471 });
472 unlockButton.setEnabled(regItemButtonGroup.isRegistrationLocked());
473 regItemButtons.addComponents(unlockButton, editRegistrationButton);
474 }
475
476 PermissionDebugUtils.addGainPerEntityPermissionButton(regItemButtons, Registration.class, dto.getUuid(),
477 EnumSet.of(CRUD.UPDATE), RegistrationStatus.PREPARATION.name());
478
479 row++;
480 registrationsGrid.addComponent(stateAndSubmitter, COL_INDEX_STATE_LABEL, row);
481 // registrationsGrid.setComponentAlignment(stateLabel, Alignment.TOP_LEFT);
482 registrationsGrid.addComponent(regItemButtonGroup, COL_INDEX_REG_ITEM, row);
483 registrationsGrid.addComponent(regItemButtons, COL_INDEX_BUTTON_GROUP, row);
484 registrationsGrid.setComponentAlignment(regItemButtons, Alignment.TOP_LEFT);
485
486 row++;
487 registrationsGrid.addComponent(footer, 0, row, COL_INDEX_BUTTON_GROUP, row);
488
489 return row;
490 }
491
492 @Override
493 public void chooseNewTypeRegistrationWorkingset(UUID registrationEntityUuid){
494 Window typeDesignationTypeCooser = new Window();
495 typeDesignationTypeCooser.setModal(true);
496 typeDesignationTypeCooser.setResizable(false);
497 typeDesignationTypeCooser.setCaption("Add new type designation");
498 Label label = new Label("Please select kind of type designation to be created.");
499 Button newSpecimenTypeDesignationButton = new Button("Specimen type designation",
500 e -> addNewTypeDesignationSet(TypeDesignationSetType.SPECIMEN_TYPE_DESIGNATION_SET, registrationEntityUuid, typeDesignationTypeCooser, e.getButton()));
501 Button newNameTypeDesignationButton = new Button("Name type designation",
502 e -> addNewTypeDesignationSet(TypeDesignationSetType.NAME_TYPE_DESIGNATION_SET, registrationEntityUuid, typeDesignationTypeCooser, e.getButton()));
503
504 VerticalLayout layout = new VerticalLayout(label, newSpecimenTypeDesignationButton, newNameTypeDesignationButton);
505 layout.setMargin(true);
506 layout.setSpacing(true);
507 layout.setComponentAlignment(newSpecimenTypeDesignationButton, Alignment.MIDDLE_CENTER);
508 layout.setComponentAlignment(newNameTypeDesignationButton, Alignment.MIDDLE_CENTER);
509 typeDesignationTypeCooser.setContent(layout);
510 UI.getCurrent().addWindow(typeDesignationTypeCooser);
511 }
512
513 protected void addNewTypeDesignationSet(TypeDesignationSetType newWorkingsetType, UUID registrationEntityUuid, Window typeDesignationTypeCooser, Button sourceButton) {
514 UI.getCurrent().removeWindow(typeDesignationTypeCooser);
515 EntityReference typifiedNameRef = typifiedNamesMap.get(registrationEntityUuid);
516 getViewEventBus().publish(this, new TypeDesignationSetEditorAction(
517 newWorkingsetType,
518 registrationEntityUuid,
519 typifiedNameRef.getUuid(),
520 sourceButton,
521 null,
522 this
523 ));
524 }
525
526 @Override
527 public void openReferenceEditor(UUID referenceUuid) {
528 // TODO Auto-generated method stub
529 }
530
531 @Override
532 public void openNameEditor(UUID nameUuid) {
533 // TODO Auto-generated method stub
534 }
535
536 @Override
537 protected String getHeaderText() {
538 return headerText;
539 }
540
541 @Override
542 public void setHeaderText(String text) {
543 this.headerText = text;
544 updateHeader();
545 }
546
547 public String getSubheaderText() {
548 return subheaderText;
549 }
550
551 @Override
552 public void setSubheaderText(String text) {
553 subheaderText = text;
554 updateHeader();
555 }
556
557 @Override
558 protected String getSubHeaderText() {
559 return subheaderText;
560 }
561
562 @Override
563 public void openDetailsPopup(String caption, List<String> messages) {
564 StringBuffer sb = new StringBuffer();
565 sb.append("<div class=\"details-popup-content\">");
566 messages.forEach(s -> sb.append(s).append("</br>"));
567 sb.append("</div>");
568 new Notification(caption, sb.toString(), Notification.Type.HUMANIZED_MESSAGE, true).show(Page.getCurrent());
569 }
570
571 @Override
572 public boolean allowAnonymousAccess() {
573 return false;
574 }
575
576 @Override
577 public Collection<Collection<GrantedAuthority>> allowedGrantedAuthorities() {
578 return null;
579 }
580
581 @Override
582 public String getAccessDeniedMessage() {
583 return accessDeniedMessage;
584 }
585
586 @Override
587 public void setAccessDeniedMessage(String accessDeniedMessage) {
588 this.accessDeniedMessage = accessDeniedMessage;
589 }
590
591 /**
592 * @return the addNewNameRegistrationButton
593 */
594 @Override
595 public Button getAddNewNameRegistrationButton() {
596 return addNewNameRegistrationButton;
597 }
598
599 @Override
600 public Button getAddExistingNameRegistrationButton() {
601 return addExistingNameButton;
602 }
603
604 @Override
605 public LazyComboBox<TaxonName> getExistingNameCombobox() {
606 return existingNameCombobox;
607 }
608
609 @Override
610 public UUID getCitationUuid() {
611 return citationUuid;
612 }
613
614 @Override
615 public Map<UUID, RegistrationDetailsItem> getRegistrationItemMap(){
616 return Collections.unmodifiableMap(registrationItemMap);
617 }
618
619 /**
620 * @param statusFieldInstantiator the statusFieldInstantiator to set
621 */
622 @Override
623 public void setStatusComponentInstantiator(RegistrationStatusFieldInstantiator statusComponentInstantiator) {
624 this.statusFieldInstantiator = statusComponentInstantiator;
625 }
626 }