Search in sources :

Example 16 with BusinessControl

use of org.olat.core.id.context.BusinessControl in project OpenOLAT by OpenOLAT.

the class InfoMessagePortletRunController method event.

@Override
protected void event(UserRequest ureq, Component source, Event event) {
    if (source == showAllLink) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(new Date());
        cal.add(Calendar.MONTH, -1);
        // fxdiff activate homes tab in top navigation and activate the correct
        // menu item
        String resourceUrl = "[HomeSite:" + ureq.getIdentity().getKey() + "][notifications:0][type=" + InfoMessage.class.getSimpleName() + ":0]" + BusinessControlFactory.getInstance().getContextEntryStringForDate(cal.getTime());
        BusinessControl bc = BusinessControlFactory.getInstance().createFromString(resourceUrl);
        WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(bc, getWindowControl());
        NewControllerFactory.getInstance().launch(ureq, bwControl);
    }
}
Also used : InfoMessage(org.olat.commons.info.InfoMessage) Calendar(java.util.Calendar) BusinessControl(org.olat.core.id.context.BusinessControl) WindowControl(org.olat.core.gui.control.WindowControl) Date(java.util.Date)

Example 17 with BusinessControl

use of org.olat.core.id.context.BusinessControl in project OpenOLAT by OpenOLAT.

the class MembersTableController method doOpenHomePage.

private void doOpenHomePage(MemberView member, UserRequest ureq) {
    String url = "[HomePage:" + member.getIdentityKey() + "]";
    BusinessControl bc = BusinessControlFactory.getInstance().createFromString(url);
    WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(bc, getWindowControl());
    NewControllerFactory.getInstance().launch(ureq, bwControl);
}
Also used : BusinessControl(org.olat.core.id.context.BusinessControl) WindowControl(org.olat.core.gui.control.WindowControl)

Example 18 with BusinessControl

use of org.olat.core.id.context.BusinessControl in project openolat by klemens.

the class NotificationsPortletRunController method event.

/**
 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.components.Component, org.olat.core.gui.control.Event)
 */
public void event(UserRequest ureq, Component source, Event event) {
    if (source == showAllLink) {
        // activate homes tab in top navigation and active bookmarks menu item
        String resourceUrl = "[HomeSite:" + ureq.getIdentity().getKey() + "][notifications:0]";
        BusinessControl bc = BusinessControlFactory.getInstance().createFromString(resourceUrl);
        WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(bc, getWindowControl());
        NewControllerFactory.getInstance().launch(ureq, bwControl);
    } else if (event == ComponentUtil.VALIDATE_EVENT && needsModelReload) {
        // updateTableModel(ureq.getLocale(), ureq.getIdentity());
        reloadModel(sortingCriteria);
        needsModelReload = false;
    }
}
Also used : BusinessControl(org.olat.core.id.context.BusinessControl) WindowControl(org.olat.core.gui.control.WindowControl)

Example 19 with BusinessControl

use of org.olat.core.id.context.BusinessControl in project openolat by klemens.

the class BookmarksPortletRunController method event.

/**
 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.components.Component, org.olat.core.gui.control.Event)
 */
public void event(UserRequest ureq, Component source, Event event) {
    if (source == showAllLink) {
        // activate homes tab in top navigation and active bookmarks menu item
        String resourceUrl = "[MyCoursesSite:0][Favorits:0]";
        BusinessControl bc = BusinessControlFactory.getInstance().createFromString(resourceUrl);
        WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(bc, getWindowControl());
        NewControllerFactory.getInstance().launch(ureq, bwControl);
    }
}
Also used : BusinessControl(org.olat.core.id.context.BusinessControl) WindowControl(org.olat.core.gui.control.WindowControl)

Example 20 with BusinessControl

use of org.olat.core.id.context.BusinessControl in project openolat by klemens.

the class PortfolioCourseNodeRunController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (source == newMapLink) {
        RepositoryEntry courseEntry = userCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
        Date deadline = courseNode.getDeadline();
        if (templateMap != null) {
            copyMap = ePFMgr.assignStructuredMapToUser(getIdentity(), templateMap, courseEntry, courseNode.getIdent(), null, deadline);
            if (copyMap != null) {
                showInfo("map.copied", StringHelper.escapeHtml(templateMap.getTitle()));
                ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapPortfolioOres(copyMap));
                ThreadLocalUserActivityLogger.log(EPLoggingAction.EPORTFOLIO_TASK_STARTED, getClass());
            }
        } else if (templateBinder != null) {
            if (copyBinder == null) {
                copyBinder = portfolioService.assignBinder(getIdentity(), templateBinder, courseEntry, courseNode.getIdent(), deadline);
                if (copyBinder != null) {
                    showInfo("map.copied", StringHelper.escapeHtml(templateBinder.getTitle()));
                    ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrap(copyBinder));
                    ThreadLocalUserActivityLogger.log(PortfolioLoggingAction.PORTFOLIO_TASK_STARTED, getClass());
                }
            } else if (copyBinder != null && copyBinder.getBinderStatus() == BinderStatus.deleted) {
                String title = translate("trashed.binder.confirm.title");
                String text = translate("trashed.binder.confirm.descr", new String[] { StringHelper.escapeHtml(copyBinder.getTitle()) });
                restoreBinderCtrl = activateYesNoDialog(ureq, title, text, restoreBinderCtrl);
                restoreBinderCtrl.setUserObject(copyBinder);
                return;
            }
        }
        updateUI(ureq);
    } else if (source == selectMapLink) {
        String resourceUrl;
        if (copyMap != null) {
            resourceUrl = "[HomeSite:" + getIdentity().getKey() + "][Portfolio:0][EPStructuredMap:" + copyMap.getKey() + "]";
        } else if (copyBinder != null) {
            resourceUrl = "[HomeSite:" + getIdentity().getKey() + "][PortfolioV2:0][MyBinders:0][Binder:" + copyBinder.getKey() + "]";
        } else {
            return;
        }
        BusinessControl bc = BusinessControlFactory.getInstance().createFromString(resourceUrl);
        WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(bc, getWindowControl());
        NewControllerFactory.getInstance().launch(ureq, bwControl);
    } else if ("ONCLICK".equals(event.getCommand())) {
        String cmd = ureq.getParameter("fcid");
        String panelId = ureq.getParameter("panel");
        if (StringHelper.containsNonWhitespace(cmd) && StringHelper.containsNonWhitespace(panelId)) {
            saveOpenPanel(ureq, panelId, "show".equals(cmd));
        }
    }
}
Also used : BusinessControl(org.olat.core.id.context.BusinessControl) RepositoryEntry(org.olat.repository.RepositoryEntry) WindowControl(org.olat.core.gui.control.WindowControl) Date(java.util.Date)

Aggregations

BusinessControl (org.olat.core.id.context.BusinessControl)80 WindowControl (org.olat.core.gui.control.WindowControl)56 OLATResourceable (org.olat.core.id.OLATResourceable)24 ContextEntry (org.olat.core.id.context.ContextEntry)22 RepositoryEntry (org.olat.repository.RepositoryEntry)16 ArrayList (java.util.ArrayList)14 Controller (org.olat.core.gui.control.Controller)8 SubscriptionContext (org.olat.core.commons.services.notifications.SubscriptionContext)6 Window (org.olat.core.gui.components.Window)6 HistoryPoint (org.olat.core.id.context.HistoryPoint)6 CourseNode (org.olat.course.nodes.CourseNode)6 Date (java.util.Date)4 UserRequest (org.olat.core.gui.UserRequest)4 DTab (org.olat.core.gui.control.generic.dtabs.DTab)4 DTabs (org.olat.core.gui.control.generic.dtabs.DTabs)4 Identity (org.olat.core.id.Identity)4 Roles (org.olat.core.id.Roles)4 BusinessControlFactory (org.olat.core.id.context.BusinessControlFactory)4 NodeRunConstructionResult (org.olat.course.run.navigation.NodeRunConstructionResult)4 IOException (java.io.IOException)3