Search in sources :

Example 1 with DeleteBinderEvent

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

the class BinderController method event.

@Override
protected void event(UserRequest ureq, Controller source, Event event) {
    if (entriesCtrl == source) {
        if (event == Event.CHANGED_EVENT) {
            if (overviewCtrl != null) {
                overviewCtrl.loadModel();
            }
        }
    } else if (overviewCtrl == source) {
        if (event == Event.CHANGED_EVENT) {
            removeAsListenerAndDispose(entriesCtrl);
            entriesCtrl = null;
            binder = portfolioService.getBinderByKey(binder.getKey());
        } else if (event instanceof SectionSelectionEvent) {
            SectionSelectionEvent sse = (SectionSelectionEvent) event;
            List<ContextEntry> entries = new ArrayList<>();
            entries.add(BusinessControlFactory.getInstance().createContextEntry(OresHelper.createOLATResourceableInstance("Section", sse.getSection().getKey())));
            doOpenEntries(ureq).activate(ureq, entries, null);
        } else if (event instanceof DeleteBinderEvent || event instanceof RestoreBinderEvent) {
            fireEvent(ureq, event);
        }
    }
}
Also used : DeleteBinderEvent(org.olat.modules.portfolio.ui.event.DeleteBinderEvent) ArrayList(java.util.ArrayList) SectionSelectionEvent(org.olat.modules.portfolio.ui.event.SectionSelectionEvent) RestoreBinderEvent(org.olat.modules.portfolio.ui.event.RestoreBinderEvent) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 2 with DeleteBinderEvent

use of org.olat.modules.portfolio.ui.event.DeleteBinderEvent 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 DeleteBinderEvent

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

the class BinderListController method event.

@Override
protected void event(UserRequest ureq, Controller source, Event event) {
    if (newBinderCtrl == source) {
        if (event == Event.DONE_EVENT) {
            loadModel();
            doOpenBinder(ureq, newBinderCtrl.getBinder()).activate(ureq, null, null);
        }
        cmc.deactivate();
        cleanUp();
    } else if (chooseNewBinderTypeCtrl == source) {
        newBinderCalloutCtrl.deactivate();
        cleanUp();
        if (event instanceof NewBinderEvent) {
            String cmd = event.getCommand();
            if (NewBinderEvent.NEW_EMPTY.equals(cmd)) {
                doNewBinder(ureq);
            } else if (NewBinderEvent.NEW_EMPTY_FROM_TEMPLATE.equals(cmd)) {
                doNewBinderFromTemplate(ureq);
            } else if (NewBinderEvent.NEW_EMPTY_FROM_COURSE.equals(cmd)) {
                doNewBinderFromCourse(ureq);
            }
        }
    } else if (searchTemplateCtrl == source) {
        if (RepositoryTableModel.TABLE_ACTION_SELECT_LINK.equals(event.getCommand())) {
            RepositoryEntry repoEntry = searchTemplateCtrl.getSelectedEntry();
            doCreateBinderFromTemplate(ureq, repoEntry);
        }
        cmc.deactivate();
        cleanUp();
    } else if (searchCourseTemplateCtrl == source) {
        if (event == ReferencableEntriesSearchController.EVENT_REPOSITORY_ENTRY_SELECTED) {
            CourseTemplateRow templateRow = searchCourseTemplateCtrl.getSelectedEntry();
            doCreateBinderFromCourseTemplate(ureq, templateRow);
        }
        cmc.deactivate();
        cleanUp();
    } else if (newBinderCalloutCtrl == source) {
        cleanUp();
    } else if (binderCtrl == source) {
        if (event instanceof DeleteBinderEvent) {
            stackPanel.popUpToController(this);
            loadModel();
        }
    } else if (cmc == source) {
        cleanUp();
    }
    super.event(ureq, source, event);
}
Also used : CourseTemplateRow(org.olat.modules.portfolio.ui.model.CourseTemplateRow) DeleteBinderEvent(org.olat.modules.portfolio.ui.event.DeleteBinderEvent) RepositoryEntry(org.olat.repository.RepositoryEntry) NewBinderEvent(org.olat.modules.portfolio.ui.event.NewBinderEvent)

Example 4 with DeleteBinderEvent

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

the class BinderListController method event.

@Override
protected void event(UserRequest ureq, Controller source, Event event) {
    if (newBinderCtrl == source) {
        if (event == Event.DONE_EVENT) {
            loadModel();
            doOpenBinder(ureq, newBinderCtrl.getBinder()).activate(ureq, null, null);
        }
        cmc.deactivate();
        cleanUp();
    } else if (chooseNewBinderTypeCtrl == source) {
        newBinderCalloutCtrl.deactivate();
        cleanUp();
        if (event instanceof NewBinderEvent) {
            String cmd = event.getCommand();
            if (NewBinderEvent.NEW_EMPTY.equals(cmd)) {
                doNewBinder(ureq);
            } else if (NewBinderEvent.NEW_EMPTY_FROM_TEMPLATE.equals(cmd)) {
                doNewBinderFromTemplate(ureq);
            } else if (NewBinderEvent.NEW_EMPTY_FROM_COURSE.equals(cmd)) {
                doNewBinderFromCourse(ureq);
            }
        }
    } else if (searchTemplateCtrl == source) {
        if (RepositoryTableModel.TABLE_ACTION_SELECT_LINK.equals(event.getCommand())) {
            RepositoryEntry repoEntry = searchTemplateCtrl.getSelectedEntry();
            doCreateBinderFromTemplate(ureq, repoEntry);
        }
        cmc.deactivate();
        cleanUp();
    } else if (searchCourseTemplateCtrl == source) {
        if (event == ReferencableEntriesSearchController.EVENT_REPOSITORY_ENTRY_SELECTED) {
            CourseTemplateRow templateRow = searchCourseTemplateCtrl.getSelectedEntry();
            doCreateBinderFromCourseTemplate(ureq, templateRow);
        }
        cmc.deactivate();
        cleanUp();
    } else if (newBinderCalloutCtrl == source) {
        cleanUp();
    } else if (binderCtrl == source) {
        if (event instanceof DeleteBinderEvent) {
            stackPanel.popUpToController(this);
            loadModel();
        }
    } else if (cmc == source) {
        cleanUp();
    }
    super.event(ureq, source, event);
}
Also used : CourseTemplateRow(org.olat.modules.portfolio.ui.model.CourseTemplateRow) DeleteBinderEvent(org.olat.modules.portfolio.ui.event.DeleteBinderEvent) RepositoryEntry(org.olat.repository.RepositoryEntry) NewBinderEvent(org.olat.modules.portfolio.ui.event.NewBinderEvent)

Example 5 with DeleteBinderEvent

use of org.olat.modules.portfolio.ui.event.DeleteBinderEvent 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)

Aggregations

DeleteBinderEvent (org.olat.modules.portfolio.ui.event.DeleteBinderEvent)6 RestoreBinderEvent (org.olat.modules.portfolio.ui.event.RestoreBinderEvent)4 ArrayList (java.util.ArrayList)2 ContextEntry (org.olat.core.id.context.ContextEntry)2 NewBinderEvent (org.olat.modules.portfolio.ui.event.NewBinderEvent)2 PageDeletedEvent (org.olat.modules.portfolio.ui.event.PageDeletedEvent)2 PageRemovedEvent (org.olat.modules.portfolio.ui.event.PageRemovedEvent)2 SectionSelectionEvent (org.olat.modules.portfolio.ui.event.SectionSelectionEvent)2 CourseTemplateRow (org.olat.modules.portfolio.ui.model.CourseTemplateRow)2 RepositoryEntry (org.olat.repository.RepositoryEntry)2