Class IcsText
Property-value escaping is deliberately absent: ical4j escapes on serialisation, and a second pass would double every backslash. What remains here is what no library can decide for us — what a fragment of HTML means as plain text, what an agenda response means as a PARTSTAT, and what a reminder means in minutes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe PARTSTAT default, both what RFC 5545 assumes and what agenda calls NEEDS_ACTION. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringagendaResponse(String partStat) The agenda response an iCalendar PARTSTAT stands for — the exact inverse ofpartStat(String), needed since a copy became something the user can answer on (EXO-89681).static StringbareAddress(String value) A CAL-ADDRESS reduced to what two spellings of one person compare as: themailto:scheme gone, trimmed, its ASCII letters lower-cased and every other character kept.static StringhtmlToText(String html) A description as plain text: the structural tags become line breaks, the rest of the markup is dropped and the entities are resolved.static InstantparseInstant(String value) An instant from the two shapes agenda supplies: an ISO instant, or a plain date which is read as midnight UTC.static StringThe PARTSTAT token for an agenda attendee response.static LongreminderMinutes(org.exoplatform.caldav.model.IcsReminder reminder) One agenda reminder as minutes before the start.
-
Field Details
-
NEEDS_ACTION
The PARTSTAT default, both what RFC 5545 assumes and what agenda calls NEEDS_ACTION.Public since EXO-89868, which has to recognise the token rather than the response name. The answer fan-out declines to write a reset, and
partStat(String)maps anything unrecognised to this value — so a caller comparing against"NEEDS_ACTION"would let a response agenda grows tomorrow through, and fan a reset out to every copy in the name of an answer nobody gave. Comparing against what would actually be written cannot make that mistake.- See Also:
-
-
Method Details
-
htmlToText
A description as plain text: the structural tags become line breaks, the rest of the markup is dropped and the entities are resolved.The browser did this by assigning to innerHTML and reading textContent, which is a parser. There is none here, so the same three transformations are applied explicitly — break tags, closing block tags, then everything else — and entities are unescaped afterwards rather than before, so that an escaped
<in the source does not become a tag that the tag removal then eats.- Parameters:
html- the description as agenda holds it- Returns:
- the text, with paragraph breaks preserved and trimmed
-
bareAddress
A CAL-ADDRESS reduced to what two spellings of one person compare as: themailto:scheme gone, trimmed, its ASCII letters lower-cased and every other character kept. RFC 5545 makes the value a URI, and clients differ on the case of the scheme; the local part of a mailbox is technically case-sensitive, but no calendar server this connector talks to treats it as such. A full lower-casing turns some non-ASCII letters into ASCII ones (the Kelvin sign intok), so a look-alike ORGANIZER would compare equal to the held copy's: the mail reader folds theFromit checks against the ORGANIZER the same way.- Parameters:
value- a CAL-ADDRESS or a bare mail address, may be null- Returns:
- the comparable address, or null when there is none
-
partStat
The PARTSTAT token for an agenda attendee response.Agenda's own values are the RFC 5545 tokens already, up to the underscore spelling the enum constant uses. Anything else becomes NEEDS-ACTION, the RFC default, rather than an invalid token a strict reader would reject.
- Parameters:
response- the attendee's response as agenda holds it- Returns:
- a valid PARTSTAT value
-
agendaResponse
The agenda response an iCalendar PARTSTAT stands for — the exact inverse ofpartStat(String), needed since a copy became something the user can answer on (EXO-89681).Deliberately narrower than the write direction. Writing maps anything unknown to the RFC default, because an object has to say something; reading maps only the four tokens agenda has a word for, and answers null for the rest — DELEGATED, or a vendor extension, is not an answer eXo can record, and guessing one would put words in the user's mouth.
- Parameters:
partStat- the PARTSTAT token as the client wrote it- Returns:
- the agenda response name (
ACCEPTED,DECLINED,TENTATIVEorNEEDS_ACTION), or null when the token maps to nothing agenda can hold
-
reminderMinutes
One agenda reminder as minutes before the start.- Parameters:
reminder- the reminder as agenda holds it- Returns:
- the minutes, or null when the reminder is unusable
-
parseInstant
An instant from the two shapes agenda supplies: an ISO instant, or a plain date which is read as midnight UTC.- Parameters:
value- the value to parse- Returns:
- the instant, or null when the value is neither
-