Package org.olat.course.nodes.projectbroker.datamodel

Examples of org.olat.course.nodes.projectbroker.datamodel.ProjectEvent


    }
   
    // Events
    for (Project.EventType eventType : Project.EventType.values()) {
      if ( projectBrokerModuleConfiguration.isProjectEventEnabled(eventType) ){
        ProjectEvent projectEvent = project.getProjectEvent(eventType);
        DateChooser dateChooserStart = uifactory.addDateChooser(eventType + "start", eventType.getI18nKey() + ".start.label", "", formLayout);
        dateChooserStart.setDateChooserTimeEnabled(true);
        // not i18n'ified yet
        dateChooserStart.setDateChooserDateFormat(CHOOSER_DATE_FORMAT);
        dateChooserStart.setCustomDateFormat(CUSTOM_DATE_FORMAT);
        dateChooserStart.setDisplaySize(CUSTOM_DATE_FORMAT.length());
        getLogger().debug("Event=" + eventType + ", startDate=" + projectEvent.getStartDate());
        dateChooserStart.setDate(projectEvent.getStartDate());
        eventStartElementList.put(eventType, dateChooserStart);
        DateChooser dateChooserEnd   = uifactory.addDateChooser(eventType + "end", eventType.getI18nKey() + ".end.label", "", formLayout);
        dateChooserEnd.setDateChooserTimeEnabled(true);
        // not i18n'ified yet
        dateChooserEnd.setDateChooserDateFormat(CHOOSER_DATE_FORMAT);
        dateChooserEnd.setCustomDateFormat(CUSTOM_DATE_FORMAT);
        dateChooserEnd.setDisplaySize(CUSTOM_DATE_FORMAT.length());
        getLogger().debug("Event=" + eventType + ", endDate=" + projectEvent.getEndDate());
        dateChooserEnd.setDate(projectEvent.getEndDate());
        eventEndElementList.put(eventType, dateChooserEnd);
        uifactory.addSpacerElement(eventType + "spacer", formLayout, false);
      }
    }
       
View Full Code Here


      Date startDate = eventStartElementList.get(eventType).getDate();
      Date endDate   = eventEndElementList.get(eventType).getDate();
      // First handle startdate
      if (   hasBeenChanged(project.getProjectEvent(eventType).getStartDate(), startDate)
          || hasBeenChanged(project.getProjectEvent(eventType).getEndDate(), endDate) ) {
        project.setProjectEvent(new ProjectEvent(eventType, startDate, endDate));
        projectChanged = true;       
      }
    }
    if (mailNotification.isSelected(0) != project.isMailNotificationEnabled()) {
      project.setMailNotificationEnabled(mailNotification.isSelected(0));
View Full Code Here

   
    // events
    List eventList = new ArrayList();
    for (Project.EventType eventType : Project.EventType.values()) {
      if (projectBrokerModuleConfiguration.isProjectEventEnabled(eventType) ) {
        ProjectEvent projectEvent = project.getProjectEvent(eventType);
        eventList.add(projectEvent);
        getLogger().debug("eventList add event=" + projectEvent);
      }
    }   
    myContent.contextPut("eventList", eventList);
View Full Code Here

    }
  }
 
  private boolean isDropboxAccessible(Project project, ProjectBrokerModuleConfiguration moduleConfig) {
    if (moduleConfig.isProjectEventEnabled(EventType.HANDOUT_EVENT)) {
      ProjectEvent handoutEvent = project.getProjectEvent(EventType.HANDOUT_EVENT);
      Date now = new Date();
      if (handoutEvent.getStartDate() != null) {
        if (now.before(handoutEvent.getStartDate())) {
          return false;
        }
      }
      if (handoutEvent.getEndDate() != null) {
        if (now.after(handoutEvent.getEndDate())) {
          return false;
        }
      }
    }
    return true;
View Full Code Here

    }
   
    // Events
    for (Project.EventType eventType : Project.EventType.values()) {
      if ( projectBrokerModuleConfiguration.isProjectEventEnabled(eventType) ){
        ProjectEvent projectEvent = project.getProjectEvent(eventType);
        DateChooser dateChooserStart = uifactory.addDateChooser(eventType + "start", "", formLayout);
        dateChooserStart.setLabel(eventType.getI18nKey() + ".start.label", null);
        dateChooserStart.setDateChooserTimeEnabled(true);
        // not i18n'ified yet
        dateChooserStart.setDateChooserDateFormat(CHOOSER_DATE_FORMAT);
        dateChooserStart.setCustomDateFormat(CUSTOM_DATE_FORMAT);
        dateChooserStart.setDisplaySize(CUSTOM_DATE_FORMAT.length());
        getLogger().info("Event=" + eventType + ", startDate=" + projectEvent.getStartDate());
        dateChooserStart.setDate(projectEvent.getStartDate());
        eventStartElementList.put(eventType, dateChooserStart);
        DateChooser dateChooserEnd   = uifactory.addDateChooser(eventType + "end", "", formLayout);
        dateChooserEnd.setLabel(eventType.getI18nKey() + ".end.label", null);
        dateChooserEnd.setDateChooserTimeEnabled(true);
        // not i18n'ified yet
        dateChooserEnd.setDateChooserDateFormat(CHOOSER_DATE_FORMAT);
        dateChooserEnd.setCustomDateFormat(CUSTOM_DATE_FORMAT);
        dateChooserEnd.setDisplaySize(CUSTOM_DATE_FORMAT.length());
        getLogger().info("Event=" + eventType + ", endDate=" + projectEvent.getEndDate());
        dateChooserEnd.setDate(projectEvent.getEndDate());
        eventEndElementList.put(eventType, dateChooserEnd);
        uifactory.addSpacerElement(eventType + "spacer", formLayout, false);
      }
    }
   
View Full Code Here

    for (Project.EventType eventType : eventStartElementList.keySet()) {
      Date startDate = eventStartElementList.get(eventType).getDate();
      Date endDate   = eventEndElementList.get(eventType).getDate();
      if (   !project.getProjectEvent(eventType).getStartDate().equals(startDate)
          || !project.getProjectEvent(eventType).getEndDate().equals(endDate) ) {
        project.setProjectEvent(new ProjectEvent(eventType, startDate, endDate));
        projectChanged = true;
      }     
    }
    if (projectChanged) {
      ProjectBrokerManagerFactory.getProjectBrokerManager().updateProject(project);
View Full Code Here

    line.append(project.getSelectedPlaces());
    line.append(TABLE_DELIMITER);
    // loop over all events
    for (Project.EventType eventType : Project.EventType.values()) {
      if (moduleConfig.isProjectEventEnabled(eventType) ) {
        ProjectEvent projectEvent = project.getProjectEvent(eventType);
        if (projectEvent.getStartDate() != null) {
          line.append(translator.translate("export.event.start.prefix"));
          line.append(" ");
          line.append(projectEvent.getFormattedStartDate());
          line.append(" ");
        }
        if (projectEvent.getEndDate() != null) {
          line.append(translator.translate("export.event.end.prefix"));
          line.append(" ");
          line.append(projectEvent.getFormattedEndDate());
        }
        line.append(TABLE_DELIMITER);
      }
    }   
    // loop over all paricipants
View Full Code Here

    putInitialPanel(content);
  }
 
  private boolean isDropboxAccessible(Project project, ProjectBrokerModuleConfiguration moduleConfig) {
    if (moduleConfig.isProjectEventEnabled(EventType.HANDOUT_EVENT)) {
      ProjectEvent handoutEvent = project.getProjectEvent(EventType.HANDOUT_EVENT);
      Date now = new Date();
      if (handoutEvent.getStartDate() != null) {
        if (now.before(handoutEvent.getStartDate())) {
          return false;
        }
      }
      if (handoutEvent.getEndDate() != null) {
        if (now.after(handoutEvent.getEndDate())) {
          return false;
        }
      }
    }
    return true;
View Full Code Here

    return (ProjectBroker) DBFactory.getInstance().loadObject(ProjectBrokerImpl.class, projectBrokerId);
  }

  private boolean isEnrollmentDateOk(Project project, ProjectBrokerModuleConfiguration moduleConfig) {
    if (moduleConfig.isProjectEventEnabled(EventType.ENROLLMENT_EVENT)) {
      ProjectEvent enrollmentEvent = project.getProjectEvent(EventType.ENROLLMENT_EVENT);
      Date now = new Date();
      if (enrollmentEvent.getStartDate() != null) {
        if (now.before(enrollmentEvent.getStartDate())) {
          return false;
        }
      }
      if (enrollmentEvent.getEndDate() != null) {
        if (now.after(enrollmentEvent.getEndDate())) {
          return false;
        }
      }
      if ( (enrollmentEvent.getStartDate() == null ) && (enrollmentEvent.getEndDate() == null) ) {
        // no enrollment date define => access ok
        return true;
      }
    }
    return true;
View Full Code Here

TOP

Related Classes of org.olat.course.nodes.projectbroker.datamodel.ProjectEvent

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.