Search in sources :

Example 1 with PropertyReferenceType

use of org.oasis_open.docs.ws_calendar.ns.soap.PropertyReferenceType in project bw-calendar-engine by Bedework.

the class BwUpdates method addRemove.

private UpdateResult addRemove(final EventInfo ei, final Component subComponent, final boolean add, final List<PropertyReferenceType> refs, final IcalCallback cb) throws WebdavException {
    for (PropertyReferenceType r : refs) {
        BasePropertyType bprop;
        QName pname;
        if (r.getBaseProperty() == null) {
            return new UpdateResult("No new value for add");
        }
        bprop = r.getBaseProperty().getValue();
        pname = r.getBaseProperty().getName();
        PropertyUpdater pu = getUpdater(bprop);
        if (pu == null) {
            return new UpdateResult("No updater for property: " + pname);
        }
        PropertyUpdateInfo ui = new PropertyUpdateInfo(bprop, pname, cb, ei, subComponent, state, userHref);
        UpdateResult ur;
        if (add) {
            ur = ui.setAdd(r);
        } else {
            ur = ui.setRemove(r);
        }
        if (ur != null) {
            return ur;
        }
        ur = pu.applyUpdate(ui);
        if (!ur.getOk()) {
            return ur;
        }
    }
    return UpdateResult.getOkResult();
}
Also used : BasePropertyType(ietf.params.xml.ns.icalendar_2.BasePropertyType) QName(javax.xml.namespace.QName) PropertyReferenceType(org.oasis_open.docs.ws_calendar.ns.soap.PropertyReferenceType) UpdateResult(org.bedework.caldav.server.sysinterface.SysIntf.UpdateResult)

Aggregations

BasePropertyType (ietf.params.xml.ns.icalendar_2.BasePropertyType)1 QName (javax.xml.namespace.QName)1 UpdateResult (org.bedework.caldav.server.sysinterface.SysIntf.UpdateResult)1 PropertyReferenceType (org.oasis_open.docs.ws_calendar.ns.soap.PropertyReferenceType)1