Search in sources :

Example 6 with ParameterList

use of net.fortuna.ical4j.model.ParameterList in project bw-calendar-engine by Bedework.

the class IcalUtil method setAttendee.

/**
 * make an attendee
 *
 * @param val BwAttendee to build from
 * @return Attendee
 * @throws Throwable
 */
public static Attendee setAttendee(final BwAttendee val) throws Throwable {
    final Attendee prop = new Attendee(val.getAttendeeUri());
    final ParameterList pars = prop.getParameters();
    setAttendeeVoter(val, pars);
    final String temp = val.getPartstat();
    if ((temp != null) && !temp.equals(IcalDefs.partstatValNeedsAction)) {
        // Not default value.
        pars.add(new PartStat(temp));
    }
    return prop;
}
Also used : ParameterList(net.fortuna.ical4j.model.ParameterList) PartStat(net.fortuna.ical4j.model.parameter.PartStat) BwAttendee(org.bedework.calfacade.BwAttendee) Attendee(net.fortuna.ical4j.model.property.Attendee)

Example 7 with ParameterList

use of net.fortuna.ical4j.model.ParameterList in project bw-calendar-engine by Bedework.

the class IcalUtil method getAttendee.

/**
 * @param cb          IcalCallback object
 * @param attProp
 * @return BwAttendee
 * @throws Throwable
 */
public static BwAttendee getAttendee(final IcalCallback cb, final Attendee attProp) throws Throwable {
    ParameterList pars = attProp.getParameters();
    BwAttendee att = initAttendeeVoter(cb, attProp.getValue(), pars);
    att.setPartstat(getOptStr(pars, "PARTSTAT"));
    if (att.getPartstat() == null) {
        att.setPartstat(IcalDefs.partstatValNeedsAction);
    }
    att.setRole(getOptStr(pars, "ROLE"));
    return att;
}
Also used : ParameterList(net.fortuna.ical4j.model.ParameterList) BwAttendee(org.bedework.calfacade.BwAttendee)

Example 8 with ParameterList

use of net.fortuna.ical4j.model.ParameterList in project bw-calendar-engine by Bedework.

the class IcalUtil method getVenue.

/**
 * @param p
 * @return String
 */
public static String getVenue(final Property p) {
    ParameterList pars = p.getParameters();
    Parameter par = pars.getParameter(Parameter.VVENUE);
    if (par == null) {
        return null;
    }
    return par.getValue();
}
Also used : ParameterList(net.fortuna.ical4j.model.ParameterList) Parameter(net.fortuna.ical4j.model.Parameter)

Example 9 with ParameterList

use of net.fortuna.ical4j.model.ParameterList in project bw-calendar-engine by Bedework.

the class IcalUtil method getAttachment.

/**
 * @param attProp
 * @return BwAttachment
 * @throws Throwable
 */
public static BwAttachment getAttachment(final Attach attProp) throws Throwable {
    BwAttachment att = new BwAttachment();
    ParameterList pars = attProp.getParameters();
    att.setFmtType(getOptStr(pars, "FMTTYPE"));
    att.setValueType(getOptStr(pars, "VALUE"));
    att.setEncoding(getOptStr(pars, "ENCODING"));
    if (att.getEncoding() == null) {
        att.setUri(attProp.getValue());
    } else {
        att.setValue(attProp.getValue());
    }
    return att;
}
Also used : ParameterList(net.fortuna.ical4j.model.ParameterList) BwAttachment(org.bedework.calfacade.BwAttachment)

Example 10 with ParameterList

use of net.fortuna.ical4j.model.ParameterList in project bw-calendar-engine by Bedework.

the class IcalUtil method setOrganizer.

/**
 * @param val
 * @return Organizer
 * @throws Throwable
 */
public static Organizer setOrganizer(final BwOrganizer val) throws Throwable {
    ParameterList pars = new ParameterList();
    String temp = val.getScheduleStatus();
    if (temp != null) {
        pars.add(new ScheduleStatus(temp));
    }
    temp = val.getCn();
    if (temp != null) {
        pars.add(new Cn(temp));
    }
    temp = val.getDir();
    if (temp != null) {
        pars.add(new Dir(temp));
    }
    temp = val.getLanguage();
    if (temp != null) {
        pars.add(new Language(temp));
    }
    temp = val.getSentBy();
    if (temp != null) {
        pars.add(new SentBy(temp));
    }
    Organizer prop = new Organizer(pars, val.getOrganizerUri());
    return prop;
}
Also used : Language(net.fortuna.ical4j.model.parameter.Language) BwOrganizer(org.bedework.calfacade.BwOrganizer) Organizer(net.fortuna.ical4j.model.property.Organizer) ParameterList(net.fortuna.ical4j.model.ParameterList) SentBy(net.fortuna.ical4j.model.parameter.SentBy) Cn(net.fortuna.ical4j.model.parameter.Cn) Dir(net.fortuna.ical4j.model.parameter.Dir) ScheduleStatus(net.fortuna.ical4j.model.parameter.ScheduleStatus)

Aggregations

ParameterList (net.fortuna.ical4j.model.ParameterList)31 Parameter (net.fortuna.ical4j.model.Parameter)13 Iterator (java.util.Iterator)5 CalFacadeException (org.bedework.calfacade.exc.CalFacadeException)5 DateTime (net.fortuna.ical4j.model.DateTime)4 XParameter (net.fortuna.ical4j.model.parameter.XParameter)4 PropertyList (net.fortuna.ical4j.model.PropertyList)3 Cn (net.fortuna.ical4j.model.parameter.Cn)3 Value (net.fortuna.ical4j.model.parameter.Value)3 BwAttendee (org.bedework.calfacade.BwAttendee)3 IOException (java.io.IOException)2 URI (java.net.URI)2 Property (net.fortuna.ical4j.model.Property)2 VEvent (net.fortuna.ical4j.model.component.VEvent)2 VVoter (net.fortuna.ical4j.model.component.VVoter)2 FmtType (net.fortuna.ical4j.model.parameter.FmtType)2 PartStat (net.fortuna.ical4j.model.parameter.PartStat)2 Attach (net.fortuna.ical4j.model.property.Attach)2 DateListProperty (net.fortuna.ical4j.model.property.DateListProperty)2 BwAttachment (org.bedework.calfacade.BwAttachment)2