use of edu.harvard.iq.dataverse.engine.command.impl.DeleteGuestbookCommand in project dataverse by IQSS.
the class ManageGuestbooksPage method deleteGuestbook.
public void deleteGuestbook() {
if (selectedGuestbook != null) {
guestbooks.remove(selectedGuestbook);
dataverse.getGuestbooks().remove(selectedGuestbook);
try {
engineService.submit(new DeleteGuestbookCommand(dvRequestService.getDataverseRequest(), getDataverse(), selectedGuestbook));
JsfHelper.addFlashMessage("The guestbook has been deleted");
} catch (CommandException ex) {
String failMessage = "The dataset guestbook cannot be deleted.";
JH.addMessage(FacesMessage.SEVERITY_FATAL, failMessage);
}
} else {
System.out.print("Selected Guestbook is null");
}
}
Aggregations