public Calendar createiCalender(Collection<Appointment> appointments, Preferences preferences) {

    boolean doExportAsMeeting =
        preferences == null
            ? global_export_attendees
            : preferences.getEntryAsBoolean(
                Export2iCalPlugin.EXPORT_ATTENDEES_PREFERENCE, global_export_attendees);

    String exportAttendeesParticipationStatus =
        preferences == null
            ? global_export_attendees_participation_status
            : preferences.getEntryAsString(
                Export2iCalPlugin.EXPORT_ATTENDEES_PARTICIPATION_STATUS_PREFERENCE,
                global_export_attendees_participation_status);

    // ensure the stored value is not empty string, if so, do not export attendees
    doExportAsMeeting =
        doExportAsMeeting
            && (exportAttendeesAttribute != null && exportAttendeesAttribute.trim().length() > 0);

    Calendar calendar = initiCalendar();
    addICalMethod(calendar, Method.PUBLISH);
    addVTimeZone(calendar);
    ComponentList components = calendar.getComponents();
    for (Appointment app : appointments) {
      VEvent event = createVEvent(app, doExportAsMeeting, exportAttendeesParticipationStatus);
      components.add(event);
    }
    return calendar;
  }
Esempio n. 2
0
 private RaplaMenuItem createMenuItem(SaveableToggleAction action) throws RaplaException {
   RaplaMenuItem menu = new RaplaMenuItem(action.getName());
   menu.setAction(new ActionWrapper(action, getI18n(), raplaImages));
   final User user = getUser();
   final Preferences preferences = getQuery().getPreferences(user);
   boolean selected = preferences.getEntryAsBoolean(action.getConfigEntry(), true);
   if (selected) {
     menu.setSelected(true);
     menu.setIcon(raplaImages.getIconFromKey("icon.checked"));
   } else {
     menu.setSelected(false);
     menu.setIcon(raplaImages.getIconFromKey("icon.unchecked"));
   }
   return menu;
 }
Esempio n. 3
0
 public void show() throws RaplaException {
   // get the options
   boolean config = preferences.getEntryAsBoolean(CalendarOptionsImpl.SHOW_CONFLICT_WARNING, true);
   showConflictWarningsField.setSelected(config);
 }
Esempio n. 4
0
 public void show() {
   checkBox.setSelected(preferences.getEntryAsBoolean(MY_OPTION, false));
 }