Package org.olat.core.util.notifications

Examples of org.olat.core.util.notifications.SubscriptionContext


    if (ACTIVITY_MENUSELECT_OVERVIEW.equals(cmd)) {
      // root node clicked display overview
      mainPanel.setContent(main);
    } else if (ACTIVITY_MENUSELECT_FORUM.equals(cmd)) {
      addLoggingResourceable(LoggingResourceable.wrap(ORES_TOOLFORUM, OlatResourceableType.forum));
      SubscriptionContext sc = new SubscriptionContext(businessGroup, INITVIEW_TOOLFORUM);
     
      WindowControl bwControl = getWindowControl();
      // calculate the new businesscontext for the forum clicked
      ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(ORES_TOOLFORUM);
      bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, bwControl);

      collabToolCtr = collabTools.createForumController(ureq, bwControl, isAdmin, ureq.getUserSession().getRoles().isGuestOnly(),  sc);
      listenTo(collabToolCtr);
      mainPanel.setContent(collabToolCtr.getInitialComponent());
    } else if (ACTIVITY_MENUSELECT_CHAT.equals(cmd)) {
      collabToolCtr = collabTools.createChatController(ureq, getWindowControl(), this.businessGroup.getName());
      mainPanel.setContent(collabToolCtr.getInitialComponent());
    } else if (ACTIVITY_MENUSELECT_CALENDAR.equals(cmd)) {
      addLoggingResourceable(LoggingResourceable.wrap(ORES_TOOLCAL, OlatResourceableType.calendar));
     
      WindowControl bwControl = getWindowControl();
      // calculate the new businesscontext for the forum clicked
      ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(ORES_TOOLCAL);
      bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, bwControl);

      collabToolCtr = collabTools.createCalendarController(ureq, bwControl, this.businessGroup, isAdmin);
      listenTo(collabToolCtr);
      mainPanel.setContent(collabToolCtr.getInitialComponent());
    } else if (ACTIVITY_MENUSELECT_INFORMATION.equals(cmd)) {
      collabToolCtr = collabTools.createNewsController(ureq, getWindowControl());
      listenTo(collabToolCtr);
      mainPanel.setContent(collabToolCtr.getInitialComponent());
    } else if (ACTIVITY_MENUSELECT_FOLDER.equals(cmd)) {
      addLoggingResourceable(LoggingResourceable.wrap(ORES_TOOLFOLDER, OlatResourceableType.sharedFolder));

      SubscriptionContext sc = new SubscriptionContext(businessGroup, INITVIEW_TOOLFOLDER);
     
      WindowControl bwControl = getWindowControl();
      // calculate the new businesscontext for the forum clicked
      ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(ORES_TOOLFOLDER);
      bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, bwControl);
View Full Code Here


      index.contextPut("hasAssessableNodes", Boolean.TRUE);
     
      // --- assessment notification subscription ---
      AssessmentNotificationsHandler anh = AssessmentNotificationsHandler.getInstance();
      SubscriptionContext subsContext = anh.getAssessmentSubscriptionContext(ureq.getIdentity(), course);
      if (subsContext != null) {
        PublisherData pData = anh.getAssessmentPublisherData(course, wControl.getBusinessControl().getAsString());
        csc = new ContextualSubscriptionController(ureq, getWindowControl(), subsContext, pData);
        listenTo(csc); // cleanup on dispose
        index.put("assessmentSubscription", csc.getInitialComponent());
View Full Code Here

    //change state of publisher so that notifications of deleted group calendars make no problems
    CalendarManager calMan = CalendarManagerFactory.getInstance().getCalendarManager();
    NotificationsManager nfm = NotificationsManager.getInstance();
    KalendarRenderWrapper calRenderWrapper = calMan.getGroupCalendar(currBusinessGroup);
    SubscriptionProvider subProvider = new SubscriptionProviderImpl(calRenderWrapper);
    SubscriptionContext subsContext = subProvider.getSubscriptionContext();
    Publisher pub = nfm.getPublisher(subsContext);
    if (pub != null) {
      pub.setState(1); //int 0 is OK -> all other is not OK
    }
   
View Full Code Here

    super(ureq, wControl);
   
    mainVC = createVelocityContainer("newusersNotifications");
   
    // subscribe/unsubscribe
    SubscriptionContext subContext = UsersSubscriptionManager.getInstance().getNewUsersSubscriptionContext();
    PublisherData publisherData = UsersSubscriptionManager.getInstance().getNewUsersPublisherData();
   
    subscriptionController = new ContextualSubscriptionController(ureq, getWindowControl(), subContext, publisherData);
    listenTo(subscriptionController);
    mainVC.put("newUsersSubscription", subscriptionController.getInitialComponent());
View Full Code Here

    //show only the options for managing dates and participants if user is admin or course coach
    ICourse course = CourseFactory.loadCourse(ores);
    CourseGroupManager cgm = course.getCourseEnvironment().getCourseGroupManager();
    if(cgm.isIdentityCourseAdministrator(ureq.getIdentity()) || cgm.isIdentityCourseCoach(ureq.getIdentity())) {
      // subscription
      subsContext = new SubscriptionContext(course, courseNode.getIdent());
      // if sc is null, then no subscription is desired
      if (subsContext != null) {
        String businessPath = wControl.getBusinessControl().getAsString();
        PublisherData pdata = new PublisherData(OresHelper.calculateTypeName(DENCourseNode.class), String.valueOf(course.getResourceableId()), businessPath);
        csc = new ContextualSubscriptionController(ureq, getWindowControl(), subsContext, pdata);
View Full Code Here

    boolean isGuestOnly = ureq.getUserSession().getRoles().isGuestOnly();
    // set logger on this run controller
    addLoggingResourceable(LoggingResourceable.wrap(ne.getCourseNode()));

    // offer subscription, but not to guests
    SubscriptionContext nodefolderSubContext = (isGuestOnly ? null : CourseModule.createSubscriptionContext(courseEnv, ne.getCourseNode()));

    OlatNamedContainerImpl namedContainer = BCCourseNode.getNodeFolderContainer((BCCourseNode) ne.getCourseNode(), courseEnv);
    VFSSecurityCallback scallback = new FolderNodeCallback(namedContainer.getRelPath(), ne, isOlatAdmin, isGuestOnly, nodefolderSubContext);
    namedContainer.setLocalSecurityCallback(scallback);
    frc = new FolderRunController(namedContainer, false, true, ureq, getWindowControl());
View Full Code Here

    }
   
   
    BusinessControl bc = wControl.getBusinessControl();
    ContextEntry ce = bc.popLauncherContextEntry();
    SubscriptionContext subsContext = new SubscriptionContext(res, WikiManager.WIKI_RESOURCE_FOLDER_NAME);
    WikiSecurityCallback callback = new WikiSecurityCallbackImpl(null, isOLatAdmin, isGuestOnly, false, isResourceOwner, subsContext);
   
    if ( ce != null ) { //jump to a certain context
      OLATResourceable ores = ce.getOLATResourceable();
      String typeName = ores.getResourceableTypeName();
View Full Code Here

  /**
   *
   */
  public SubscriptionContext getNewUsersSubscriptionContext() {
    return new SubscriptionContext(RES_NAME, RES_ID, NEW);
  }
View Full Code Here

    PublisherData publisherData = new PublisherData(RES_NAME, NEW, ce.toString());
    return publisherData;
  }
 
  public Subscriber getNewUsersSubscriber(Identity identity) {
    SubscriptionContext context = getNewUsersSubscriptionContext();
    Publisher publisher = NotificationsManager.getInstance().getPublisher(context);
    if(publisher == null) {
      return null;
    }
    return NotificationsManager.getInstance().getSubscriber(identity, publisher);
View Full Code Here

  /**
   * Subscribe to notifications of new identity created
   */
  public void subscribe(Identity identity) {
    PublisherData data = getNewUsersPublisherData();
    SubscriptionContext context = getNewUsersSubscriptionContext();
    NotificationsManager.getInstance().subscribe(identity, context, data);
  }
View Full Code Here

TOP

Related Classes of org.olat.core.util.notifications.SubscriptionContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.