Package org.olat.commons.calendar.ui.events

Examples of org.olat.commons.calendar.ui.events.KalendarModifiedEvent


         
          vc_collabtools.contextPut("calendarToolEnabled", Boolean.FALSE);

          // notify calendar components to refresh their calendars
          CoordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(
              new KalendarModifiedEvent(), OresHelper.lookupType(CalendarManager.class)
          );
        }
        lastCalendarEnabledState = newCalendarEnabledState;
      }

      // update quota form: only show when enabled
      if (collabTools.isToolEnabled(CollaborationTools.TOOL_FOLDER)) {
        vc_collabtools.contextPut("folderToolEnabled", Boolean.TRUE);
        if (ureq.getUserSession().getRoles().isOLATAdmin()) {
          vc_collabtools.put("quota", quotaCtr.getInitialComponent());
        }
      } else {
        vc_collabtools.contextPut("folderToolEnabled", Boolean.FALSE);
      }
     
    } else if (source == this.newsController) {
      if (event.equals(Event.DONE_EVENT)) {
        String news = this.newsController.getNewsValue();
        collabTools.saveNews(news);
      }
     
    } else if (source == this.calendarForm) { 
      collabTools.saveCalendarAccess(new Long(calendarForm.getCalendarAccess()));
      // notify calendar components to refresh their calendars
      CoordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(
          new KalendarModifiedEvent(), OresHelper.lookupType(CalendarManager.class)
      );
    }  
  }
View Full Code Here


        }
        // CourseCalendarConfigController
        if(changedCourseConfig.isCalendarEnabled()!= initialCourseConfig.isCalendarEnabled() && calCfgCtr.getLoggingAction()!=null) {
          ThreadLocalUserActivityLogger.log(calCfgCtr.getLoggingAction(), getClass());
          // notify calendar components to refresh their calendars
          CoordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(new KalendarModifiedEvent(), OresHelper.lookupType(CalendarManager.class));
        }
        // CourseConfigGlossaryController
        if((changedCourseConfig.getGlossarySoftKey()==null && initialCourseConfig.getGlossarySoftKey()!=null)
            || (changedCourseConfig.getGlossarySoftKey()!=null && initialCourseConfig.getGlossarySoftKey()==null)
            && cglosCtr.getLoggingAction()!=null) {
View Full Code Here

    CourseCalendars myCal = CourseCalendars.createCourseCalendarsWrapper(ureq, wControl, course);
    CourseCalendarSubscription calSubscription = myCal.createSubscription(ureq);
    if(CalEditController.getAutoSubscribe(config)) {
      if(!calSubscription.isSubscribed()) {
        calSubscription.subscribe(false);
        ureq.getUserSession().getSingleUserEventCenter().fireEventToListenersOf(new KalendarModifiedEvent(), OresHelper.lookupType(CalendarManager.class));
      }
    }
   
    calCtr = new CourseCalendarController(ureq, wControl, myCal, calSubscription, course);
View Full Code Here

  }
 
  public void event(UserRequest ureq, Component source, Event event) {
    if (event == ComponentUtil.VALIDATE_EVENT && dirty) {
      dirty = false;
      fireEvent(ureq, new KalendarModifiedEvent());
    } else if (event == ComponentUtil.VALIDATE_EVENT && weeklyCalendar.isDirty() && modifiedCalenderDirty  ) {
      KalendarRenderWrapper kalendarRenderWrapper = weeklyCalendar.getKalendarRenderWrapper(modifiedCalendarId);
      kalendarRenderWrapper.reloadKalendar()
    }else if (source == vcMain) {
      if (event.getCommand().equals(CMD_PREVIOUS_WEEK)) {
        weeklyCalendar.previousWeek();
      } else if (event.getCommand().equals(CMD_NEXT_WEEK)) {
        weeklyCalendar.nextWeek();
      }
    } else if (source == thisWeekLink){
      Calendar cal = CalendarUtils.createCalendarInstance(ureq.getLocale());
      weeklyCalendar.setFocus(cal.get(Calendar.YEAR), cal.get(Calendar.WEEK_OF_YEAR));
    } else if (source == searchLink) {
      if (searchController != null) searchController.dispose();
      ArrayList allCalendarWrappers = new ArrayList(calendarWrappers);
      allCalendarWrappers.addAll(importedCalendarWrappers);
      searchController = new SearchAllCalendarsController(ureq, getWindowControl(), translator, allCalendarWrappers);
      searchController.addControllerListener(this);
      if (cmc != null) cmc.dispose();
      cmc = new CloseableModalController(getWindowControl(), translator.translate("close"), searchController.getInitialComponent());
      cmc.activate();
    } else if (source == subscribeButton || source == unsubscribeButton) {
      if (subscriptionController != null) subscriptionController.dispose();
      if(calendarSubscription.isSubscribed() == (source == unsubscribeButton)) {
        subscriptionController = calendarSubscription.triggerSubscribeAction();
      }
      if (subscriptionController != null) {
        // activate subscription controller
        subscriptionController.addControllerListener(this);
        mainPanel.setContent(subscriptionController.getInitialComponent());
      } else {
        vcMain.contextPut("isSubscribed", new Boolean(calendarSubscription.isSubscribed()));
        CoordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(new KalendarModifiedEvent(), OresHelper.lookupType(CalendarManager.class));
      }
    } else if (source == weeklyCalendar) {
      if (event instanceof KalendarGUIEditEvent) {
        KalendarGUIEditEvent guiEvent = (KalendarGUIEditEvent) event;
        KalendarEvent kalendarEvent = guiEvent.getKalendarEvent();
View Full Code Here

  public void event(UserRequest ureq, Controller source, Event event) {
    Kalendar affectedCal = null;
    if (dirty) {
      dirty = false;
      fireEvent(ureq, new KalendarModifiedEvent());
    }
    if (source == editController) {
      affectedCal = editController.getKalendarEvent().getCalendar();
      cmc.deactivate();
      weeklyCalendar.setDirty(true);
View Full Code Here

   
  }
 
  public void event(Event event) {
    if (event instanceof KalendarModifiedEvent) {
      KalendarModifiedEvent kalendarModifiedEvent = (KalendarModifiedEvent)event;
      if (kalendarModifiedEvent.getType()!=null
          && kalendarModifiedEvent.getCalendarId()!=null
          && weeklyCalendar.getKalendarRenderWrapper(kalendarModifiedEvent.getCalendarId())!=null
          && kalendarModifiedEvent.getType().equals(weeklyCalendar.getKalendarRenderWrapper(kalendarModifiedEvent.getCalendarId()).getKalendar().getType())         
          && kalendarModifiedEvent.getCalendarId().equals(weeklyCalendar.getKalendarRenderWrapper(kalendarModifiedEvent.getCalendarId()).getKalendar().getCalendarID())) {
        // the event is for my calendar => reload it       
       
        //keeping a reference to the dirty calendar as reloading here raises an nested do in sync error. Using the component validation event to reload
        modifiedCalendarId  = kalendarModifiedEvent.getCalendarId();
        modifiedCalenderDirty = true;
        weeklyCalendar.setDirty(true);
      }
    }
  }
View Full Code Here

        boolean successfullyPersist = persistCalendar(loadedCal);
        return new Boolean(successfullyPersist);
      }
    });
    // inform all controller about calendar change for reload
    CoordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(new KalendarModifiedEvent(cal), OresHelper.lookupType(CalendarManager.class));
    return persistSuccessful.booleanValue();
  }
View Full Code Here

        boolean successfullyPersist = persistCalendar(loadedCal);
        return new Boolean(successfullyPersist);
      }
    });
    // inform all controller about calendar change for reload
    CoordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(new KalendarModifiedEvent(cal), OresHelper.lookupType(CalendarManager.class));
    return removeSuccessful.booleanValue();
    }
View Full Code Here

    Kalendar loadedCal = getCalendarFromCache(cal.getType(),cal.getCalendarID());
    loadedCal.removeEvent(kalendarEvent); // remove old event
    loadedCal.addEvent(kalendarEvent); // add changed event
    boolean successfullyPersist = persistCalendar(loadedCal);
    // inform all controller about calendar change for reload
    CoordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(new KalendarModifiedEvent(cal), OresHelper.lookupType(CalendarManager.class));
    return successfullyPersist;
    }
View Full Code Here

TOP

Related Classes of org.olat.commons.calendar.ui.events.KalendarModifiedEvent

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.