Search in sources :

Example 11 with ParameterList

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

the class IcalUtil method setVoter.

/**
 * make a voter
 *
 * @param val BwAttendee to build from
 * @return Attendee
 * @throws Throwable
 */
public static Voter setVoter(final BwAttendee val) throws Throwable {
    final Voter prop = new Voter(val.getAttendeeUri());
    final ParameterList pars = prop.getParameters();
    setAttendeeVoter(val, pars);
    final String temp = val.getPartstat();
    pars.add(new PartStat(temp));
    return prop;
}
Also used : Voter(net.fortuna.ical4j.model.property.Voter) VVoter(net.fortuna.ical4j.model.component.VVoter) ParameterList(net.fortuna.ical4j.model.ParameterList) PartStat(net.fortuna.ical4j.model.parameter.PartStat)

Example 12 with ParameterList

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

the class IcalUtil method makeXparlist.

/**
 * @param pars
 * @return par list - always non-null
 * @throws Throwable
 */
public static ParameterList makeXparlist(final List<BwXproperty.Xpar> pars) throws Throwable {
    ParameterList xparl = new ParameterList();
    if (pars == null) {
        return xparl;
    }
    for (BwXproperty.Xpar xpar : pars) {
        String xval = xpar.getValue();
        if ((xval.indexOf(":") >= 0) || (xval.indexOf(";") >= 0) || (xval.indexOf(",") >= 0)) {
            xval = "\"" + xval + "\"";
        }
        xparl.add(ParameterFactoryImpl.getInstance().createParameter(xpar.getName().toUpperCase(), xval));
    }
    return xparl;
}
Also used : BwXproperty(org.bedework.calfacade.BwXproperty) ParameterList(net.fortuna.ical4j.model.ParameterList) Xpar(org.bedework.calfacade.BwXproperty.Xpar)

Example 13 with ParameterList

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

the class JsonParameters method addFields.

public static void addFields(final JsonGenerator jgen, final Property prop) throws CalFacadeException {
    try {
        jgen.writeStartObject();
        ParameterList pl = prop.getParameters();
        if ((pl != null) && (pl.size() > 0)) {
            Iterator it = pl.iterator();
            while (it.hasNext()) {
                Parameter p = (Parameter) it.next();
                String nm = p.getName().toLowerCase();
                jgen.writeFieldName(nm);
                if (multiMap.get(nm) == null) {
                    jgen.writeString(p.getValue());
                } else {
                    outValue(jgen, p);
                }
            }
        }
        jgen.writeEndObject();
    } catch (Throwable t) {
        throw new CalFacadeException(t);
    }
}
Also used : Iterator(java.util.Iterator) ParameterList(net.fortuna.ical4j.model.ParameterList) Parameter(net.fortuna.ical4j.model.Parameter) CalFacadeException(org.bedework.calfacade.exc.CalFacadeException)

Example 14 with ParameterList

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

the class BwEventUtil method getUidPar.

private static String getUidPar(final Property p) {
    ParameterList pars = p.getParameters();
    Parameter par = pars.getParameter(BwXproperty.xparUid);
    if (par == null) {
        return null;
    }
    return par.getValue();
}
Also used : ParameterList(net.fortuna.ical4j.model.ParameterList) Parameter(net.fortuna.ical4j.model.Parameter) XParameter(net.fortuna.ical4j.model.parameter.XParameter)

Example 15 with ParameterList

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

the class BwEventUtil method testXparams.

/* ====================================================================
                      Private methods
     ==================================================================== */
private static void testXparams(final Property p, final Holder<Boolean> hasXparams) {
    if (hasXparams.value) {
        // No need to check
        return;
    }
    ParameterList params = p.getParameters();
    Iterator parit = params.iterator();
    while (parit.hasNext()) {
        Parameter param = (Parameter) parit.next();
        if (!(param instanceof XParameter)) {
            continue;
        }
        XParameter xpar = (XParameter) param;
        if (xpar.getName().toUpperCase().equals(BwXproperty.xparUid)) {
            continue;
        }
        hasXparams.value = true;
    }
}
Also used : Iterator(java.util.Iterator) ParameterList(net.fortuna.ical4j.model.ParameterList) Parameter(net.fortuna.ical4j.model.Parameter) XParameter(net.fortuna.ical4j.model.parameter.XParameter) XParameter(net.fortuna.ical4j.model.parameter.XParameter)

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