Package org.bedework.convert.ical
Class IcalUtil
java.lang.Object
org.bedework.convert.ical.IcalUtil
- Direct Known Subclasses:
BwEvent2Ical,BwFreeBusyUtil,Ical2BwEvent,VAlarmUtil,VFreeUtil
Class to provide utility methods for ical4j classes
- Author:
- Mike Douglass douglm rpi.edu
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddParameter(net.fortuna.ical4j.model.Property prop, net.fortuna.ical4j.model.Parameter val) static voidaddProperty(net.fortuna.ical4j.model.Component comp, net.fortuna.ical4j.model.Property val) static voidaddXproperty(net.fortuna.ical4j.model.PropertyList<net.fortuna.ical4j.model.Property> pl, String name, List<BwXproperty.Xpar> pars, String val) static net.fortuna.ical4j.model.parameter.AltRepgetAltRep(net.fortuna.ical4j.model.Property prop) Return the AltRep parameter if it existsstatic BwAttachmentgetAttachment(net.fortuna.ical4j.model.property.Attach attProp) static BwAttendeegetAttendee(IcalCallback cb, net.fortuna.ical4j.model.property.Attendee attProp) static org.bedework.convert.ical.IcalUtil.DurationRepeatgetDurationRepeat(net.fortuna.ical4j.model.PropertyList<net.fortuna.ical4j.model.Property> pl) Both or none appear once onlystatic StringgetLang(net.fortuna.ical4j.model.Property p) static StringReturn optional string parameterstatic StringReturn optional string propertystatic BwOrganizergetOrganizer(IcalCallback cb, net.fortuna.ical4j.model.property.Organizer orgProp) Make an organizerstatic net.fortuna.ical4j.model.ParametergetParameter(net.fortuna.ical4j.model.Property prop, String name) static StringgetParameterVal(net.fortuna.ical4j.model.Property prop, String name) static net.fortuna.ical4j.model.PropertyList<net.fortuna.ical4j.model.Property>getProperties(net.fortuna.ical4j.model.Component comp, String name) static net.fortuna.ical4j.model.PropertygetProperty(net.fortuna.ical4j.model.Component comp, String name) static StringReturn required string propertystatic Iterator<?>getReqStrs(net.fortuna.ical4j.model.PropertyList<net.fortuna.ical4j.model.Property> pl, String name) Return an Iterator over required String attributesstatic BwAlarm.TriggerValgetTrigger(net.fortuna.ical4j.model.PropertyList<net.fortuna.ical4j.model.Property> pl, boolean absentOk) static org.bedework.util.misc.response.GetEntitiesResponse<net.fortuna.ical4j.model.component.VLocation>getVlocations(BwEvent ev) static BwAttendeegetVoter(IcalCallback cb, net.fortuna.ical4j.model.property.CalendarAddress ca) static net.fortuna.ical4j.model.ComponentThis is used to extract the full iCalendar representation from the x-properties.static BwAttendeeinitAttendeeVoter(IcalCallback cb, String val, net.fortuna.ical4j.model.ParameterList pars) static net.fortuna.ical4j.model.DateTimeAlways return a DateTime objectstatic Collection<BwDateTime>makeDateTimes(net.fortuna.ical4j.model.property.DateListProperty val) static net.fortuna.ical4j.model.property.DtEndmakeDtEnd(BwDateTime val) Make a DtEnd from the objectstatic net.fortuna.ical4j.model.property.DtEndmakeDtEnd(BwDateTime val, net.fortuna.ical4j.model.TimeZoneRegistry tzreg) Make a DtEnd from the objectstatic net.fortuna.ical4j.model.property.DuemakeDue(BwDateTime val, net.fortuna.ical4j.model.TimeZoneRegistry tzreg) Make a Due from the objectstatic net.fortuna.ical4j.model.ParameterListmakeXparlist(List<BwXproperty.Xpar> pars) static List<net.fortuna.ical4j.model.component.Participant>parseParticipants(List<BwXproperty> xprops) parseVpollCandidates(BwEvent poll) parseVpollVoters(BwEvent poll) static net.fortuna.ical4j.model.property.Attachmake an attachmentstatic net.fortuna.ical4j.model.property.AttendeesetAttendee(BwAttendee val) make an attendeestatic voidsetDates(String userHref, EventInfo ei, net.fortuna.ical4j.model.property.DtStart dtStart, net.fortuna.ical4j.model.property.DtEnd dtEnd, net.fortuna.ical4j.model.property.Duration duration) Set the dates in an event given a start and one or none of end and duration.static net.fortuna.ical4j.model.property.OrganizersetOrganizer(BwOrganizer val) static net.fortuna.ical4j.model.component.ParticipantsetVoter(BwAttendee val) make a voterstatic org.bedework.util.misc.response.GetEntityResponse<net.fortuna.ical4j.model.component.VLocation>toVlocation(BwLocation loc, org.bedework.convert.ical.IcalUtil.Relto relTo) static voidxpropertiesToIcal(net.fortuna.ical4j.model.PropertyList<net.fortuna.ical4j.model.Property> pl, List<BwXproperty> xprops)
-
Constructor Details
-
IcalUtil
public IcalUtil()
-
-
Method Details
-
getXcomp
This is used to extract the full iCalendar representation from the x-properties. This is used to avoid extending the schema to preserve extra properties specifically on attendee and attachments.- Parameters:
ev- with possible xpropscompName- we want- Returns:
- the Component or null
-
xpropertiesToIcal
public static void xpropertiesToIcal(net.fortuna.ical4j.model.PropertyList<net.fortuna.ical4j.model.Property> pl, List<BwXproperty> xprops) - Parameters:
pl- ical4j property listxprops- list of bw xprops
-
makeXparlist
- Parameters:
pars- List of Xpar- Returns:
- par list - always non-null
-
addXproperty
public static void addXproperty(net.fortuna.ical4j.model.PropertyList<net.fortuna.ical4j.model.Property> pl, String name, List<BwXproperty.Xpar> pars, String val) - Parameters:
pl- ical4j PropertyListname- of xproppars- List of Xparval- new value
-
getLang
- Parameters:
p- ical4j Property- Returns:
- String
-
setOrganizer
- Parameters:
val- bw organizer object- Returns:
- Organizer
-
getOrganizer
public static BwOrganizer getOrganizer(IcalCallback cb, net.fortuna.ical4j.model.property.Organizer orgProp) Make an organizer- Parameters:
cb- IcalCallback objectorgProp- ical4j Organizer- Returns:
- BwOrganizer
-
setAttachment
make an attachment- Parameters:
val- bw attachment object- Returns:
- Attendee
-
getAttachment
- Parameters:
attProp- Attach- Returns:
- BwAttachment
-
setAttendee
make an attendee- Parameters:
val- BwAttendee to build from- Returns:
- Attendee
-
setVoter
make a voter- Parameters:
val- BwAttendee to build from- Returns:
- Attendee
-
toVlocation
public static org.bedework.util.misc.response.GetEntityResponse<net.fortuna.ical4j.model.component.VLocation> toVlocation(BwLocation loc, org.bedework.convert.ical.IcalUtil.Relto relTo) - Parameters:
loc- the location- Returns:
- A VLOCATION object.
-
getVlocations
public static org.bedework.util.misc.response.GetEntitiesResponse<net.fortuna.ical4j.model.component.VLocation> getVlocations(BwEvent ev) -
parseVpollVoters
public static Map<String,net.fortuna.ical4j.model.component.Participant> parseVpollVoters(BwEvent poll) - Parameters:
poll- the poll entity- Returns:
- Parsed PARTICIPANT components map - key is voter cua.
-
parseParticipants
public static List<net.fortuna.ical4j.model.component.Participant> parseParticipants(List<BwXproperty> xprops) - Parameters:
xprops- String participant objects- Returns:
- Parsed PARTICIPANT components list.
-
parseVpollCandidates
- Parameters:
poll- the poll entity- Returns:
- Parsed components.
-
getAttendee
public static BwAttendee getAttendee(IcalCallback cb, net.fortuna.ical4j.model.property.Attendee attProp) - Parameters:
cb- IcalCallback objectattProp- ical4j attendee- Returns:
- BwAttendee
-
getVoter
public static BwAttendee getVoter(IcalCallback cb, net.fortuna.ical4j.model.property.CalendarAddress ca) - Parameters:
cb- IcalCallback objectca- - identifies the voter- Returns:
- BwAttendee
-
initAttendeeVoter
public static BwAttendee initAttendeeVoter(IcalCallback cb, String val, net.fortuna.ical4j.model.ParameterList pars) - Parameters:
cb- IcalCallback objectval- init attendeepars- par list- Returns:
- BwAttendee
-
getTrigger
public static BwAlarm.TriggerVal getTrigger(net.fortuna.ical4j.model.PropertyList<net.fortuna.ical4j.model.Property> pl, boolean absentOk) - Parameters:
pl- ical4j property listabsentOk- - if true and absent returns an empty result.- Returns:
- TriggerVal
-
getDurationRepeat
public static org.bedework.convert.ical.IcalUtil.DurationRepeat getDurationRepeat(net.fortuna.ical4j.model.PropertyList<net.fortuna.ical4j.model.Property> pl) Both or none appear once only- Parameters:
pl- ical4j property list- Returns:
- DurationRepeat
-
makeDateTimes
public static Collection<BwDateTime> makeDateTimes(net.fortuna.ical4j.model.property.DateListProperty val) - Parameters:
val- ical4j DateListProperty- Returns:
- Collection
-
addProperty
public static void addProperty(net.fortuna.ical4j.model.Component comp, net.fortuna.ical4j.model.Property val) - Parameters:
comp- ical4j Componentval- ical4j property
-
addParameter
public static void addParameter(net.fortuna.ical4j.model.Property prop, net.fortuna.ical4j.model.Parameter val) - Parameters:
prop- ical4j propertyval- ical4j parameter
-
getParameter
public static net.fortuna.ical4j.model.Parameter getParameter(net.fortuna.ical4j.model.Property prop, String name) - Parameters:
prop- ical4j propertyname- of property- Returns:
- Parameter
-
getParameterVal
- Parameters:
prop- ical4j propertyname- of property- Returns:
- Parameter value
-
getProperty
public static net.fortuna.ical4j.model.Property getProperty(net.fortuna.ical4j.model.Component comp, String name) - Parameters:
comp- ical4j Componentname- of property- Returns:
- Property
-
getProperties
public static net.fortuna.ical4j.model.PropertyList<net.fortuna.ical4j.model.Property> getProperties(net.fortuna.ical4j.model.Component comp, String name) - Parameters:
comp- ical4j Componentname- of property- Returns:
- PropertyList
-
getReqStrs
public static Iterator<?> getReqStrs(net.fortuna.ical4j.model.PropertyList<net.fortuna.ical4j.model.Property> pl, String name) Return an Iterator over required String attributes- Parameters:
pl- ical4j property listname- of property- Returns:
- Iterator over required String attributes
-
getReqStr
public static String getReqStr(net.fortuna.ical4j.model.PropertyList<net.fortuna.ical4j.model.Property> pl, String name) Return required string property- Parameters:
pl- ical4j property listname- of property- Returns:
- String
-
getOptStr
public static String getOptStr(net.fortuna.ical4j.model.PropertyList<net.fortuna.ical4j.model.Property> pl, String name) Return optional string property- Parameters:
pl- ical4j property listname- of property- Returns:
- String or null
-
getOptStr
Return optional string parameter- Parameters:
pl- ical4j property listname- of property- Returns:
- String
-
getAltRep
public static net.fortuna.ical4j.model.parameter.AltRep getAltRep(net.fortuna.ical4j.model.Property prop) Return the AltRep parameter if it exists- Parameters:
prop- ical4j property- Returns:
- AltRep
-
makeDtEnd
Make a DtEnd from the object- Parameters:
val- a BwDateTime- Returns:
- DtEnd ical4j dtend object
-
makeDtEnd
public static net.fortuna.ical4j.model.property.DtEnd makeDtEnd(BwDateTime val, net.fortuna.ical4j.model.TimeZoneRegistry tzreg) Make a DtEnd from the object- Parameters:
val- a BwDateTimetzreg- timezone registry- Returns:
- DtEnd
-
makeDue
public static net.fortuna.ical4j.model.property.Due makeDue(BwDateTime val, net.fortuna.ical4j.model.TimeZoneRegistry tzreg) Make a Due from the object- Parameters:
val- a BwDateTimetzreg- timezone registry- Returns:
- Due
-
makeDateTime
Always return a DateTime object- Parameters:
dt- bw date time- Returns:
- DateTime
-
setDates
public static void setDates(String userHref, EventInfo ei, net.fortuna.ical4j.model.property.DtStart dtStart, net.fortuna.ical4j.model.property.DtEnd dtEnd, net.fortuna.ical4j.model.property.Duration duration) Set the dates in an event given a start and one or none of end and duration.- Parameters:
userHref- for changesetei- the eventdtStart- startdtEnd- endduration- duration
-