Search in sources :

Example 1 with PageDeletedEvent

use of org.olat.modules.portfolio.ui.event.PageDeletedEvent in project OpenOLAT by OpenOLAT.

the class AbstractPageListController method event.

@Override
public void event(UserRequest ureq, Controller source, Event event) {
    if (pageCtrl == source) {
        if (event == Event.CHANGED_EVENT) {
            loadModel(ureq, null);
            fireEvent(ureq, Event.CHANGED_EVENT);
        } else if (event instanceof PageRemovedEvent) {
            loadModel(ureq, null);
            stackPanel.popUpToController(this);
            fireEvent(ureq, Event.CHANGED_EVENT);
        } else if (event instanceof PageDeletedEvent) {
            loadModel(ureq, null);
            fireEvent(ureq, event);
        }
    } else if (commentsCtrl == source) {
        if (event == Event.CHANGED_EVENT || "comment_count_changed".equals(event.getCommand())) {
            loadModel(ureq, null);
            fireEvent(ureq, Event.CHANGED_EVENT);
        }
        cmc.deactivate();
        cleanUp();
    } else if (editAssignmentCtrl == source || moveAssignmentCtrl == source) {
        if (event == Event.CHANGED_EVENT || event == Event.DONE_EVENT) {
            loadModel(ureq, null);
            fireEvent(ureq, Event.CHANGED_EVENT);
        }
        cmc.deactivate();
        cleanUp();
    } else if (confirmCloseSectionCtrl == source) {
        if (DialogBoxUIFactory.isYesEvent(event)) {
            PortfolioElementRow row = (PortfolioElementRow) confirmCloseSectionCtrl.getUserObject();
            doClose(ureq, row);
        }
    } else if (confirmReopenSectionCtrl == source) {
        if (DialogBoxUIFactory.isYesEvent(event)) {
            PortfolioElementRow row = (PortfolioElementRow) confirmReopenSectionCtrl.getUserObject();
            doReopen(ureq, row);
        }
    } else if (confirmDeleteAssignmentCtrl == source) {
        if (DialogBoxUIFactory.isYesEvent(event)) {
            PortfolioElementRow row = (PortfolioElementRow) confirmDeleteAssignmentCtrl.getUserObject();
            doDelete(row);
            loadModel(ureq, null);
        }
    } else if (cmc == source) {
        cleanUp();
    }
    super.event(ureq, source, event);
}
Also used : PortfolioElementRow(org.olat.modules.portfolio.ui.model.PortfolioElementRow) PageDeletedEvent(org.olat.modules.portfolio.ui.event.PageDeletedEvent) PageRemovedEvent(org.olat.modules.portfolio.ui.event.PageRemovedEvent)

Example 2 with PageDeletedEvent

use of org.olat.modules.portfolio.ui.event.PageDeletedEvent in project OpenOLAT by OpenOLAT.

the class TableOfContentController method event.

@Override
protected void event(UserRequest ureq, Controller source, Event event) {
    if (newSectionCtrl == source || editSectionCtrl == source || editSectionDatesCtrl == source || newPageCtrl == source || newAssignmentCtrl == source) {
        if (event == Event.DONE_EVENT) {
            loadModel();
            fireEvent(ureq, Event.CHANGED_EVENT);
        }
        cmc.deactivate();
        cleanUp();
    } else if (pageCtrl == source) {
        if (event == Event.CHANGED_EVENT) {
            loadModel();
            fireEvent(ureq, Event.CHANGED_EVENT);
        } else if (event instanceof PageRemovedEvent || event instanceof PageDeletedEvent) {
            stackPanel.popController(pageCtrl);
            loadModel();
            fireEvent(ureq, Event.CHANGED_EVENT);
        }
    } else if (binderMetadataCtrl == source) {
        if (event == Event.DONE_EVENT) {
            binder = binderMetadataCtrl.getBinder();
            loadModel();
            fireEvent(ureq, Event.CHANGED_EVENT);
        }
        cmc.deactivate();
        cleanUp();
    } else if (confirmCloseSectionCtrl == source) {
        if (DialogBoxUIFactory.isYesEvent(event)) {
            SectionRow row = (SectionRow) confirmCloseSectionCtrl.getUserObject();
            doClose(row);
            loadModel();
            fireEvent(ureq, Event.CHANGED_EVENT);
        }
    } else if (confirmReopenSectionCtrl == source) {
        if (DialogBoxUIFactory.isYesEvent(event)) {
            SectionRow row = (SectionRow) confirmReopenSectionCtrl.getUserObject();
            doReopen(row);
            loadModel();
            fireEvent(ureq, Event.CHANGED_EVENT);
        }
    } else if (confirmDeleteSectionCtrl == source) {
        if (DialogBoxUIFactory.isYesEvent(event)) {
            SectionRow row = (SectionRow) confirmDeleteSectionCtrl.getUserObject();
            doDelete(row);
            loadModel();
            fireEvent(ureq, Event.CHANGED_EVENT);
        }
    } else if (moveBinderToTrashCtrl == source) {
        if (event == Event.DONE_EVENT) {
            doMoveBinderToTrash();
            fireEvent(ureq, new DeleteBinderEvent());
        }
        cmc.deactivate();
        cleanUp();
    } else if (deleteBinderCtrl == source) {
        if (event == Event.DONE_EVENT) {
            doDeleteBinder();
            fireEvent(ureq, new DeleteBinderEvent());
        }
        cmc.deactivate();
        cleanUp();
    } else if (confirmRestoreBinderCtrl == source) {
        if (DialogBoxUIFactory.isYesEvent(event)) {
            doRestore();
            loadModel();
            fireEvent(ureq, new RestoreBinderEvent());
        }
    } else if (commentsCtrl == source) {
        if ("comment_count_changed".equals(event.getCommand())) {
            loadModel();
            fireEvent(ureq, Event.CHANGED_EVENT);
        }
        cmc.deactivate();
        cleanUp();
    } else if (cmc == source) {
        cleanUp();
    }
}
Also used : PageDeletedEvent(org.olat.modules.portfolio.ui.event.PageDeletedEvent) DeleteBinderEvent(org.olat.modules.portfolio.ui.event.DeleteBinderEvent) PageRemovedEvent(org.olat.modules.portfolio.ui.event.PageRemovedEvent) RestoreBinderEvent(org.olat.modules.portfolio.ui.event.RestoreBinderEvent)

Example 3 with PageDeletedEvent

use of org.olat.modules.portfolio.ui.event.PageDeletedEvent in project OpenOLAT by OpenOLAT.

the class PageRunController method doDelete.

private void doDelete(UserRequest ureq) {
    portfolioService.deletePage(page);
    fireEvent(ureq, new PageDeletedEvent());
}
Also used : PageDeletedEvent(org.olat.modules.portfolio.ui.event.PageDeletedEvent)

Example 4 with PageDeletedEvent

use of org.olat.modules.portfolio.ui.event.PageDeletedEvent in project openolat by klemens.

the class TableOfContentController method event.

@Override
protected void event(UserRequest ureq, Controller source, Event event) {
    if (newSectionCtrl == source || editSectionCtrl == source || editSectionDatesCtrl == source || newPageCtrl == source || newAssignmentCtrl == source) {
        if (event == Event.DONE_EVENT) {
            loadModel();
            fireEvent(ureq, Event.CHANGED_EVENT);
        }
        cmc.deactivate();
        cleanUp();
    } else if (pageCtrl == source) {
        if (event == Event.CHANGED_EVENT) {
            loadModel();
            fireEvent(ureq, Event.CHANGED_EVENT);
        } else if (event instanceof PageRemovedEvent || event instanceof PageDeletedEvent) {
            stackPanel.popController(pageCtrl);
            loadModel();
            fireEvent(ureq, Event.CHANGED_EVENT);
        }
    } else if (binderMetadataCtrl == source) {
        if (event == Event.DONE_EVENT) {
            binder = binderMetadataCtrl.getBinder();
            loadModel();
            fireEvent(ureq, Event.CHANGED_EVENT);
        }
        cmc.deactivate();
        cleanUp();
    } else if (confirmCloseSectionCtrl == source) {
        if (DialogBoxUIFactory.isYesEvent(event)) {
            SectionRow row = (SectionRow) confirmCloseSectionCtrl.getUserObject();
            doClose(row);
            loadModel();
            fireEvent(ureq, Event.CHANGED_EVENT);
        }
    } else if (confirmReopenSectionCtrl == source) {
        if (DialogBoxUIFactory.isYesEvent(event)) {
            SectionRow row = (SectionRow) confirmReopenSectionCtrl.getUserObject();
            doReopen(row);
            loadModel();
            fireEvent(ureq, Event.CHANGED_EVENT);
        }
    } else if (confirmDeleteSectionCtrl == source) {
        if (DialogBoxUIFactory.isYesEvent(event)) {
            SectionRow row = (SectionRow) confirmDeleteSectionCtrl.getUserObject();
            doDelete(row);
            loadModel();
            fireEvent(ureq, Event.CHANGED_EVENT);
        }
    } else if (moveBinderToTrashCtrl == source) {
        if (event == Event.DONE_EVENT) {
            doMoveBinderToTrash();
            fireEvent(ureq, new DeleteBinderEvent());
        }
        cmc.deactivate();
        cleanUp();
    } else if (deleteBinderCtrl == source) {
        if (event == Event.DONE_EVENT) {
            doDeleteBinder();
            fireEvent(ureq, new DeleteBinderEvent());
        }
        cmc.deactivate();
        cleanUp();
    } else if (confirmRestoreBinderCtrl == source) {
        if (DialogBoxUIFactory.isYesEvent(event)) {
            doRestore();
            loadModel();
            fireEvent(ureq, new RestoreBinderEvent());
        }
    } else if (commentsCtrl == source) {
        if ("comment_count_changed".equals(event.getCommand())) {
            loadModel();
            fireEvent(ureq, Event.CHANGED_EVENT);
        }
        cmc.deactivate();
        cleanUp();
    } else if (cmc == source) {
        cleanUp();
    }
}
Also used : PageDeletedEvent(org.olat.modules.portfolio.ui.event.PageDeletedEvent) DeleteBinderEvent(org.olat.modules.portfolio.ui.event.DeleteBinderEvent) PageRemovedEvent(org.olat.modules.portfolio.ui.event.PageRemovedEvent) RestoreBinderEvent(org.olat.modules.portfolio.ui.event.RestoreBinderEvent)

Example 5 with PageDeletedEvent

use of org.olat.modules.portfolio.ui.event.PageDeletedEvent in project openolat by klemens.

the class PageRunController method doDelete.

private void doDelete(UserRequest ureq) {
    portfolioService.deletePage(page);
    fireEvent(ureq, new PageDeletedEvent());
}
Also used : PageDeletedEvent(org.olat.modules.portfolio.ui.event.PageDeletedEvent)

Aggregations

PageDeletedEvent (org.olat.modules.portfolio.ui.event.PageDeletedEvent)6 PageRemovedEvent (org.olat.modules.portfolio.ui.event.PageRemovedEvent)4 DeleteBinderEvent (org.olat.modules.portfolio.ui.event.DeleteBinderEvent)2 RestoreBinderEvent (org.olat.modules.portfolio.ui.event.RestoreBinderEvent)2 PortfolioElementRow (org.olat.modules.portfolio.ui.model.PortfolioElementRow)2