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;
  }
Beispiel #2
0
  protected void createPage(
      String url, final String user, final String errorMessage, HttpServletResponse response)
      throws IOException {
    final String userName = Tools.createXssSafeString(user);

    response.setContentType("text/html; charset=ISO-8859-1");
    PrintWriter out = response.getWriter();
    String linkPrefix = "../"; // request.getPathTranslated() != null ? "../" : "";

    out.println("<html>");
    out.println("  <head>");
    // add the link to the stylesheet for this page within the <head> tag
    out.println(
        "    <link REL=\"stylesheet\" href=\"" + linkPrefix + "login.css\" type=\"text/css\">");
    // tell the html page where its favourite icon is stored
    out.println(
        "    <link REL=\"shortcut icon\" type=\"image/x-icon\" href=\""
            + linkPrefix
            + "images/favicon.ico\">");
    out.println("    <title>");
    String title = null;
    final String defaultTitle = i18n.getString("rapla.title");
    try {
      final Preferences systemPreferences = facade.getSystemPreferences();
      title = systemPreferences.getEntryAsString(ContainerImpl.TITLE, defaultTitle);
    } catch (RaplaException e) {
      title = defaultTitle;
    }

    out.println(title);
    out.println("    </title>");
    out.println("  </head>");
    out.println("  <body>");
    out.println("    <form method=\"post\">");
    if (url != null) {
      out.println(
          "       <input type=\"hidden\" name=\"url\" value=\""
              + Tools.createXssSafeString(url)
              + "\"/>");
    }
    out.println("           <div class=\"loginOuterPanel\">");
    out.println("               <div class=\"loginInputPanel\">");
    final String userNameValue = userName != null ? userName : "";
    out.println(
        "                   <input name=\"userName\" type=\"text\" value=\""
            + userNameValue
            + "\">");
    out.println("                   <input name=\"password\"type=\"password\" >");
    out.println("               </div>");
    out.println("               <div class=\"loginCommandPanel\">");
    out.println("                   <button type=\"submit\" class=\"sendButton\">login</button>");
    out.println("               </div>");
    out.println("           </div>");
    if (errorMessage != null) {
      out.println("       <div class=\"errorMessage\">" + errorMessage + "</div>");
    }
    out.println("  </body>");
    out.println("</html>");
    out.close();
  }
Beispiel #3
0
 public void show() throws RaplaException {
   createPanel();
   config = preferences.getEntry(MailPlugin.MAILSERVER_CONFIG, null);
   if (config == null) {
     config = configService.getConfig();
   }
   readConfig(config);
   defaultSender.setText(
       preferences.getEntryAsString(MailPlugin.DEFAULT_SENDER_ENTRY, "rapla@domainname"));
 }
Beispiel #4
0
 public void show() throws RaplaException {
   create();
   String language = preferences.getEntryAsString(RaplaLocale.LANGUAGE_ENTRY, null);
   languageChooser.setSelectedLanguage(language);
 }