Search in sources :

Example 21 with BwString

use of org.bedework.calfacade.BwString in project bw-calendar-engine by Bedework.

the class CategoryFieldRule method field.

public void field(String name) throws Exception {
    BwString s = null;
    if (top() instanceof BwString) {
        s = (BwString) pop();
    }
    BwCategory cat = (BwCategory) top();
    if (shareableEntityTags(cat, name)) {
        return;
    }
    if (name.equals("word")) {
        cat.setWord(s);
    } else if (name.equals("description")) {
        cat.setDescription(s);
    } else if (name.equals("uid")) {
        cat.setUid(stringFld());
    } else if (name.equals("byteSize")) {
        cat.setByteSize(intFld());
    } else {
        unknownTag(name);
    }
}
Also used : BwCategory(org.bedework.calfacade.BwCategory) BwString(org.bedework.calfacade.BwString)

Example 22 with BwString

use of org.bedework.calfacade.BwString in project bw-calendar-engine by Bedework.

the class ContactFieldRule method field.

public void field(String name) throws Exception {
    if (name.equals("name")) {
        // Expect the value on stack top
        BwString s = (BwString) pop();
        ((BwContact) top()).setCn(s);
        return;
    }
    if (name.equals("cn")) {
        // Expect the value on stack top
        BwString s = (BwString) pop();
        ((BwContact) top()).setCn(s);
        return;
    }
    BwContact c = (BwContact) top();
    if (shareableEntityTags(c, name)) {
        return;
    }
    if (name.equals("value")) {
    // PRE3.5
    } else if (name.equals("phone")) {
        c.setPhone(stringFld());
    } else if (name.equals("email")) {
        c.setEmail(stringFld());
    } else if (name.equals("link")) {
        c.setLink(stringFld());
    } else if (name.equals("uid")) {
        c.setUid(stringFld());
    } else if (name.equals("byteSize")) {
        c.setByteSize(intFld());
    } else {
        unknownTag(name);
    }
}
Also used : BwString(org.bedework.calfacade.BwString) BwContact(org.bedework.calfacade.BwContact)

Example 23 with BwString

use of org.bedework.calfacade.BwString in project bw-calendar-engine by Bedework.

the class FilterFieldRule method field.

public void field(String name) throws Exception {
    BwStringBase str = null;
    if (top() instanceof BwStringBase) {
        str = (BwStringBase) pop();
    }
    BwFilterDef f = (BwFilterDef) top();
    if (name.equals("name")) {
        f.setName(stringFld());
    } else if (name.equals("definition")) {
        f.setDefinition(stringFld());
    } else if (name.equals("description")) {
        f.addDescription((BwLongString) str);
    } else if (name.equals("displayName")) {
        f.addDisplayName((BwString) str);
    } else if (name.equals("descriptions")) {
    // Nothing to do.
    } else if (name.equals("displayNames")) {
    // Nothing to do.
    }
}
Also used : BwStringBase(org.bedework.calfacade.base.BwStringBase) BwFilterDef(org.bedework.calfacade.BwFilterDef) BwString(org.bedework.calfacade.BwString)

Example 24 with BwString

use of org.bedework.calfacade.BwString in project bw-calendar-engine by Bedework.

the class LocationFieldRule method field.

@Override
public void field(final String name) throws Exception {
    BwString str = null;
    if (top() instanceof BwString) {
        str = (BwString) pop();
    }
    BwLocation l = (BwLocation) getTop(BwLocation.class, name);
    if (shareableEntityTags(l, name)) {
        return;
    }
    if (name.equals("address")) {
        l.setAddress(str);
        return;
    }
    if (name.equals("subaddress")) {
        l.setSubaddress(str);
        return;
    }
    if (name.equals("link")) {
        l.setLink(stringFld());
        return;
    }
    if (name.equals("uid")) {
        l.setUid(stringFld());
        return;
    }
    if (name.equals("byteSize")) {
        l.setByteSize(intFld());
        return;
    }
    unknownTag(name);
}
Also used : BwLocation(org.bedework.calfacade.BwLocation) BwString(org.bedework.calfacade.BwString)

Example 25 with BwString

use of org.bedework.calfacade.BwString in project bw-calendar-engine by Bedework.

the class BwEventUtil method checkLocation.

/* Return true if value matches a location - which may be added as
   * a result
   */
private static boolean checkLocation(final IcalCallback cb, final ChangeTable chg, final BwEvent ev, final Property prop) throws CalFacadeException {
    final Parameter param = prop.getParameter(XcalTags.xBedeworkLocationKey.getLocalPart());
    final String val = prop.getValue();
    final BwLocation evloc = ev.getLocation();
    final BwLocation loc;
    if (param == null) {
        final BwString sval = new BwString(null, val);
        loc = cb.getLocation(sval);
        if (loc == null) {
            return false;
        }
    } else {
        final GetEntityResponse<BwLocation> resp = cb.fetchLocationByKey(param.getValue(), val);
        if (resp.getStatus() != ok) {
            return false;
        }
        loc = resp.getEntity();
    }
    ev.setLocation(loc);
    chg.changed(PropertyIndex.PropertyInfoIndex.LOCATION, evloc, loc);
    return true;
}
Also used : BwLocation(org.bedework.calfacade.BwLocation) Parameter(net.fortuna.ical4j.model.Parameter) XParameter(net.fortuna.ical4j.model.parameter.XParameter) BwString(org.bedework.calfacade.BwString) BwString(org.bedework.calfacade.BwString)

Aggregations

BwString (org.bedework.calfacade.BwString)30 BwEvent (org.bedework.calfacade.BwEvent)14 BwCategory (org.bedework.calfacade.BwCategory)11 BwContact (org.bedework.calfacade.BwContact)11 BwLocation (org.bedework.calfacade.BwLocation)9 CalFacadeException (org.bedework.calfacade.exc.CalFacadeException)9 BwAttendee (org.bedework.calfacade.BwAttendee)7 BwXproperty (org.bedework.calfacade.BwXproperty)6 EventInfo (org.bedework.calfacade.svc.EventInfo)6 ChangeTableEntry (org.bedework.calfacade.util.ChangeTableEntry)6 WebdavException (org.bedework.webdav.servlet.shared.WebdavException)5 Period (net.fortuna.ical4j.model.Period)4 UpdateResult (org.bedework.caldav.server.sysinterface.SysIntf.UpdateResult)4 BwDateTime (org.bedework.calfacade.BwDateTime)4 BwFreeBusyComponent (org.bedework.calfacade.BwFreeBusyComponent)4 BwOrganizer (org.bedework.calfacade.BwOrganizer)4 BwRequestStatus (org.bedework.calfacade.BwRequestStatus)4 BwStringBase (org.bedework.calfacade.base.BwStringBase)4 BwLongString (org.bedework.calfacade.BwLongString)3 Parameter (net.fortuna.ical4j.model.Parameter)2