Search in sources :

Example 1 with NewIframeUriEvent

use of org.olat.core.gui.control.generic.iframe.NewIframeUriEvent in project OpenOLAT by OpenOLAT.

the class SinglePageController method event.

/**
 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
 */
@Override
public void event(UserRequest ureq, Controller source, Event event) {
    if (source == idc) {
        if (event instanceof OlatCmdEvent) {
            OlatCmdEvent oce = (OlatCmdEvent) event;
            String nodeId = oce.getSubcommand();
            ThreadLocalUserActivityLogger.log(CourseLoggingAction.COURSE_BROWSE_GOTO_NODE, getClass(), CoreLoggingResourceable.wrapSpUri(GOTO_NID + nodeId));
            // refire to listening controllers
            fireEvent(ureq, event);
        } else if (event instanceof NewIframeUriEvent) {
            NewIframeUriEvent iframeEvent = (NewIframeUriEvent) event;
            String newUri = iframeEvent.getNewUri();
            setCurURI(newUri);
            // log this uri change
            ThreadLocalUserActivityLogger.log(CourseLoggingAction.NODE_SINGLEPAGE_GET_FILE, getClass(), CoreLoggingResourceable.wrapSpUri(newUri));
        }
    } else if (source == htmlEditorController) {
        idc.setCurrentURI(g_curURI);
        mainPanel.setContent(myContent);
    }
}
Also used : NewIframeUriEvent(org.olat.core.gui.control.generic.iframe.NewIframeUriEvent) OlatCmdEvent(org.olat.core.gui.components.htmlsite.OlatCmdEvent)

Example 2 with NewIframeUriEvent

use of org.olat.core.gui.control.generic.iframe.NewIframeUriEvent in project OpenOLAT by OpenOLAT.

the class CPDisplayController method event.

@Override
protected void event(UserRequest ureq, Controller source, Event event) {
    if (source == cpContentCtr) {
        // a .html click within the contentpackage
        if (event instanceof NewInlineUriEvent) {
            NewInlineUriEvent nue = (NewInlineUriEvent) event;
            // adjust the tree selection to the current choice if found
            selectTreeNode(ureq, nue.getNewUri());
        } else if (event instanceof NewIframeUriEvent) {
            NewIframeUriEvent nue = (NewIframeUriEvent) event;
            selectTreeNode(ureq, nue.getNewUri());
        }
    // else ignore (e.g. misplaced olatcmd event (inner olat link found in a
    // contentpackaging file)
    } else if (source == printPopup) {
        removeAsListenerAndDispose(printPopup);
        removeAsListenerAndDispose(printController);
        printController = null;
        printPopup = null;
    } else if (source == printController) {
        if (Event.DONE_EVENT == event) {
            List<String> nodeToPrint = printController.getSelectedNodeIdentifiers();
            printPages(nodeToPrint);
        }
        printPopup.deactivate();
        removeAsListenerAndDispose(printPopup);
        removeAsListenerAndDispose(printController);
        printController = null;
        printPopup = null;
    }
}
Also used : NewIframeUriEvent(org.olat.core.gui.control.generic.iframe.NewIframeUriEvent) NewInlineUriEvent(org.olat.core.gui.components.htmlsite.NewInlineUriEvent)

Example 3 with NewIframeUriEvent

use of org.olat.core.gui.control.generic.iframe.NewIframeUriEvent in project openolat by klemens.

the class CPDisplayController method event.

@Override
protected void event(UserRequest ureq, Controller source, Event event) {
    if (source == cpContentCtr) {
        // a .html click within the contentpackage
        if (event instanceof NewInlineUriEvent) {
            NewInlineUriEvent nue = (NewInlineUriEvent) event;
            // adjust the tree selection to the current choice if found
            selectTreeNode(ureq, nue.getNewUri());
        } else if (event instanceof NewIframeUriEvent) {
            NewIframeUriEvent nue = (NewIframeUriEvent) event;
            selectTreeNode(ureq, nue.getNewUri());
        }
    // else ignore (e.g. misplaced olatcmd event (inner olat link found in a
    // contentpackaging file)
    } else if (source == printPopup) {
        removeAsListenerAndDispose(printPopup);
        removeAsListenerAndDispose(printController);
        printController = null;
        printPopup = null;
    } else if (source == printController) {
        if (Event.DONE_EVENT == event) {
            List<String> nodeToPrint = printController.getSelectedNodeIdentifiers();
            printPages(nodeToPrint);
        }
        printPopup.deactivate();
        removeAsListenerAndDispose(printPopup);
        removeAsListenerAndDispose(printController);
        printController = null;
        printPopup = null;
    }
}
Also used : NewIframeUriEvent(org.olat.core.gui.control.generic.iframe.NewIframeUriEvent) NewInlineUriEvent(org.olat.core.gui.components.htmlsite.NewInlineUriEvent)

Example 4 with NewIframeUriEvent

use of org.olat.core.gui.control.generic.iframe.NewIframeUriEvent in project openolat by klemens.

the class SinglePageController method event.

/**
 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
 */
@Override
public void event(UserRequest ureq, Controller source, Event event) {
    if (source == idc) {
        if (event instanceof OlatCmdEvent) {
            OlatCmdEvent oce = (OlatCmdEvent) event;
            String nodeId = oce.getSubcommand();
            ThreadLocalUserActivityLogger.log(CourseLoggingAction.COURSE_BROWSE_GOTO_NODE, getClass(), CoreLoggingResourceable.wrapSpUri(GOTO_NID + nodeId));
            // refire to listening controllers
            fireEvent(ureq, event);
        } else if (event instanceof NewIframeUriEvent) {
            NewIframeUriEvent iframeEvent = (NewIframeUriEvent) event;
            String newUri = iframeEvent.getNewUri();
            setCurURI(newUri);
            // log this uri change
            ThreadLocalUserActivityLogger.log(CourseLoggingAction.NODE_SINGLEPAGE_GET_FILE, getClass(), CoreLoggingResourceable.wrapSpUri(newUri));
        }
    } else if (source == htmlEditorController) {
        idc.setCurrentURI(g_curURI);
        mainPanel.setContent(myContent);
    }
}
Also used : NewIframeUriEvent(org.olat.core.gui.control.generic.iframe.NewIframeUriEvent) OlatCmdEvent(org.olat.core.gui.components.htmlsite.OlatCmdEvent)

Aggregations

NewIframeUriEvent (org.olat.core.gui.control.generic.iframe.NewIframeUriEvent)4 NewInlineUriEvent (org.olat.core.gui.components.htmlsite.NewInlineUriEvent)2 OlatCmdEvent (org.olat.core.gui.components.htmlsite.OlatCmdEvent)2