Search in sources :

Example 1 with DeleteGuestbookCommand

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");
    }
}
Also used : DeleteGuestbookCommand(edu.harvard.iq.dataverse.engine.command.impl.DeleteGuestbookCommand) CommandException(edu.harvard.iq.dataverse.engine.command.exception.CommandException)

Aggregations

CommandException (edu.harvard.iq.dataverse.engine.command.exception.CommandException)1 DeleteGuestbookCommand (edu.harvard.iq.dataverse.engine.command.impl.DeleteGuestbookCommand)1