Revision 16c4d668
Added by Andreas Kohlbecker about 6 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/component/registration/RegistrationItem.java | ||
---|---|---|
197 | 197 |
setComponentError(new UserError("Citation is missing")); |
198 | 198 |
} |
199 | 199 |
|
200 |
updateUI(regDto.getBibliographicCitationString(), regDto.getCreated(), regDto.getDatePublished(), regDto.getMessages().size(),
|
|
200 |
updateUI(regDto.getBibliographicCitationString(), regDto.getCreated(), regDto.getDatePublished(), regDto.getValidationProblems().size(),
|
|
201 | 201 |
navigationEvent, null, regDto, regDto.getSubmitterUserName()); |
202 | 202 |
} |
203 | 203 |
|
src/main/java/eu/etaxonomy/cdm/vaadin/model/registration/RegistrationWorkingSet.java | ||
---|---|---|
151 | 151 |
public int messagesCount() { |
152 | 152 |
int messagesCount = 0; |
153 | 153 |
for(RegistrationDTO dto : getRegistrationDTOs()) { |
154 |
messagesCount = messagesCount + dto.getMessages().size();
|
|
154 |
messagesCount = messagesCount + dto.getValidationProblems().size();
|
|
155 | 155 |
} |
156 | 156 |
return messagesCount; |
157 | 157 |
} |
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/ListPresenter.java | ||
---|---|---|
145 | 145 |
RegistrationDTO regDto = getWorkingSetService().loadDtoById(registrationId); |
146 | 146 |
if(event.getProperty().equals("messages")){ |
147 | 147 |
|
148 |
getView().openDetailsPopup("Messages", regDto.getMessages());
|
|
148 |
getView().openDetailsPopup("Messages", regDto.getValidationProblems());
|
|
149 | 149 |
|
150 | 150 |
} else if(event.getProperty().equals("blockedBy")){ |
151 | 151 |
|
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationDTO.java | ||
---|---|---|
56 | 56 |
|
57 | 57 |
private Registration reg; |
58 | 58 |
|
59 |
private List<String> messages = new ArrayList<>();
|
|
59 |
private List<String> validationProblems = new ArrayList<>();
|
|
60 | 60 |
|
61 | 61 |
private Set<TypedEntityReference<Registration>> blockedBy; |
62 | 62 |
|
... | ... | |
105 | 105 |
typeDesignationManager = new TypeDesignationSetManager(reg.getTypeDesignations()); |
106 | 106 |
summary = typeDesignationManager.buildString().print(); |
107 | 107 |
} catch (RegistrationValidationException e) { |
108 |
messages.add("Validation errors: " + e.getMessage());
|
|
108 |
validationProblems.add("Validation errors: " + e.getMessage());
|
|
109 | 109 |
} |
110 | 110 |
break; |
111 | 111 |
} |
... | ... | |
382 | 382 |
/** |
383 | 383 |
* @return |
384 | 384 |
*/ |
385 |
public List<String> getMessages() {
|
|
386 |
return messages;
|
|
385 |
public List<String> getValidationProblems() {
|
|
386 |
return validationProblems;
|
|
387 | 387 |
} |
388 | 388 |
|
389 | 389 |
} |
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorkingsetPresenter.java | ||
---|---|---|
546 | 546 |
public void onShowRegistrationWorkingSetMessages(ShowDetailsEvent<?,?> event) { |
547 | 547 |
List<String> messages = new ArrayList<>(); |
548 | 548 |
for(RegistrationDTO dto : workingset.getRegistrationDTOs()){ |
549 |
dto.getMessages().forEach(m -> messages.add(dto.getSummary() + ": " + m));
|
|
549 |
dto.getValidationProblems().forEach(m -> messages.add(dto.getSummary() + ": " + m));
|
|
550 | 550 |
} |
551 | 551 |
if(event.getProperty().equals("messages")){ |
552 | 552 |
getView().openDetailsPopup("Messages", messages); |
... | ... | |
559 | 559 |
RegistrationDTO regDto = regWorkingSetService.loadDtoById((Integer)event.getIdentifier()); |
560 | 560 |
if(event.getProperty().equals("messages")){ |
561 | 561 |
if(getView() != null){ |
562 |
getView().openDetailsPopup("Messages", regDto.getMessages());
|
|
562 |
getView().openDetailsPopup("Messages", regDto.getValidationProblems());
|
|
563 | 563 |
} |
564 | 564 |
} |
565 | 565 |
} |
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorksetViewBean.java | ||
---|---|---|
344 | 344 |
|
345 | 345 |
Button messageButton = new Button(FontAwesome.COMMENT); |
346 | 346 |
messageButton.setStyleName(ValoTheme.BUTTON_TINY); // + " " + RegistrationStyles.STYLE_FRIENDLY_FOREGROUND); |
347 |
if(dto.getMessages().isEmpty()){ |
|
347 |
|
|
348 |
if(dto.getValidationProblems().isEmpty()){ |
|
348 | 349 |
messageButton.setEnabled(false); |
349 | 350 |
} else { |
350 | 351 |
messageButton.addClickListener(e -> getViewEventBus().publish(this, |
... | ... | |
357 | 358 |
) |
358 | 359 |
); |
359 | 360 |
} |
360 |
messageButton.setCaption("<span class=\"" + RegistrationStyles.BUTTON_BADGE +"\"> " + dto.getMessages().size() + "</span>");
|
|
361 |
messageButton.setCaption("<span class=\"" + RegistrationStyles.BUTTON_BADGE +"\"> " + dto.getValidationProblems().size() + "</span>");
|
|
361 | 362 |
messageButton.setCaptionAsHtml(true); |
362 | 363 |
buttonGroup.addComponent(messageButton); |
363 | 364 |
|
Also available in: Unified diff
renaming RegistationDTO.messages to validationProblems