added URL to ical

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-01-03 19:53:20 +01:00
parent bb54e6fb24
commit e45164b82c
4 changed files with 14 additions and 10 deletions
@@ -125,7 +125,7 @@ public class BaseAppointment implements Appointment {
}
@Override
public String ical(String calendarIdentifier) { // TODO: implement
public String ical(String calendarIdentifier,String urlTemplate) { // TODO: implement
var sb = new StringBuilder();
sb.append(contentLine(BEGIN,VEVENT));
if (calendarIdentifier != null) sb.append(contentLine(UID,"%s@%s".formatted(id(),calendarIdentifier)));
@@ -133,6 +133,7 @@ public class BaseAppointment implements Appointment {
end().map(end -> contentLine(DTEND,end.format(ICAL_DATE_FORMAT).replace(" ","T"))).ifPresent(sb::append);
sb.append(contentLine(SUMMARY,title()));
sb.append(contentLine(DESCRIPTION,description()));
sb.append(contentLine(URL,urlTemplate.replace("{}",""+id())));
coords().map(Coords::icalFormat).map(geo -> contentLine(GEO,geo)).ifPresent(sb::append);
location().map(loc -> contentLine(LOCATION,loc)).ifPresent(sb::append);
for (var attachment : attachments()) sb.append(contentLine("ATTACH;FMTYPE=%s".formatted(attachment.mime()),attachment.url().toString()));
@@ -36,6 +36,7 @@ public class Util {
public static final String PRODID = "PRODID";
public static final String SUMMARY = "SUMMARY";
public static final String UID = "UID";
public static final String URL = "URL";
public static final String VERSION = "VERSION";
public static final String VEVENT = "VEVENT";
public static final String VCALENDAR = "VCALENDAR";