use of org.bedework.util.indexing.IndexException in project bw-calendar-engine by Bedework.
the class DocBuilder method indexContacts.
private void indexContacts(final Set<BwContact> val) throws CalFacadeException {
try {
if (Util.isEmpty(val)) {
return;
}
// Only index enough to retrieve the actual contact
startArray(getJname(PropertyInfoIndex.CONTACT));
for (final BwContact c : val) {
c.fixNames(basicSysprops, principal);
startObject();
makeField(PropertyInfoIndex.HREF, c.getHref());
makeField(PropertyInfoIndex.CN, c.getCn());
makeField(ParameterInfoIndex.UID.getJname(), c.getUid());
makeField(ParameterInfoIndex.ALTREP.getJname(), c.getLink());
endObject();
}
endArray();
} catch (final IndexException e) {
throw new CalFacadeException(e);
}
}
use of org.bedework.util.indexing.IndexException in project bw-calendar-engine by Bedework.
the class DocBuilder method indexReqStat.
private void indexReqStat(final Set<BwRequestStatus> val) throws CalFacadeException {
try {
if (Util.isEmpty(val)) {
return;
}
startArray(getJname(PropertyInfoIndex.REQUEST_STATUS));
for (final BwRequestStatus rs : val) {
value(rs.strVal());
}
endArray();
} catch (final IndexException e) {
throw new CalFacadeException(e);
}
}
use of org.bedework.util.indexing.IndexException in project bw-calendar-engine by Bedework.
the class DocBuilder method indexBwStrings.
private void indexBwStrings(final PropertyInfoIndex pi, final Set<? extends BwStringBase> val) throws CalFacadeException {
try {
if (Util.isEmpty(val)) {
return;
}
startArray(getJname(pi));
for (final BwStringBase s : val) {
makeField((PropertyInfoIndex) null, s);
}
endArray();
} catch (final IndexException e) {
throw new CalFacadeException(e);
}
}
use of org.bedework.util.indexing.IndexException in project bw-calendar-engine by Bedework.
the class DocBuilder method makeLocKeys.
private void makeLocKeys(final List<BwLocation.KeyFld> vals) throws CalFacadeException {
try {
if (Util.isEmpty(vals)) {
return;
}
startArray(getJname(PropertyInfoIndex.LOC_KEYS_FLD));
for (final BwLocation.KeyFld kf : vals) {
startObject();
makeField(PropertyInfoIndex.NAME, kf.getKeyName());
makeField(PropertyInfoIndex.VALUE, kf.getKeyVal());
endObject();
}
endArray();
} catch (final IndexException e) {
throw new CalFacadeException(e);
}
}
use of org.bedework.util.indexing.IndexException in project bw-calendar-engine by Bedework.
the class EntityBuilder method restoreBwDateTimeSet.
private Set<BwDateTime> restoreBwDateTimeSet(final PropertyInfoIndex pi) throws CalFacadeException {
final List<Object> vals = getFieldValues(pi);
if (Util.isEmpty(vals)) {
return null;
}
final Set<BwDateTime> tms = new TreeSet<>();
for (final Object o : vals) {
try {
pushFields(o);
final String date = getString(PropertyInfoIndex.LOCAL);
final String utcDate = getString(PropertyInfoIndex.UTC);
final String tzid = getString(PropertyInfoIndex.TZID);
final boolean floating = getBool(PropertyInfoIndex.FLOATING);
final boolean dateType = date.length() == 8;
final BwDateTime tm = BwDateTime.makeBwDateTime(dateType, date, utcDate, tzid, floating);
tms.add(tm);
} catch (final IndexException ie) {
throw new CalFacadeException(ie);
} finally {
popFields();
}
}
return tms;
}
Aggregations