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);
}
}
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);
}
}
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.
}
}
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);
}
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;
}
Aggregations