use of org.bedework.util.indexing.IndexException in project bw-calendar-engine by Bedework.
the class DocBuilder method indexOrganizer.
private void indexOrganizer(final BwOrganizer val) throws CalFacadeException {
try {
if (val == null) {
return;
}
startObject(getJname(PropertyInfoIndex.ORGANIZER));
startObject(getJname(PropertyInfoIndex.PARAMETERS));
makeField(ParameterInfoIndex.SCHEDULE_STATUS.getJname(), val.getScheduleStatus());
makeField(ParameterInfoIndex.CN.getJname(), val.getCn());
makeField(ParameterInfoIndex.DIR.getJname(), val.getDir());
makeField(ParameterInfoIndex.LANGUAGE.getJname(), val.getLanguage());
makeField(ParameterInfoIndex.SENT_BY.getJname(), val.getSentBy());
endObject();
makeField(getJname(PropertyInfoIndex.URI), val.getOrganizerUri());
endObject();
} 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 restoreAlarms.
private Set<BwAlarm> restoreAlarms() throws CalFacadeException {
final List<Object> vals = getFieldValues(PropertyInfoIndex.VALARM);
if (Util.isEmpty(vals)) {
return null;
}
final Set<BwAlarm> alarms = new TreeSet<>();
for (final Object o : vals) {
try {
pushFields(o);
final BwAlarm alarm = new BwAlarm();
alarm.setOwnerHref(getString(PropertyInfoIndex.OWNER));
alarm.setPublick(getBooleanNotNull(PropertyInfoIndex.PUBLIC));
final String action = getString(PropertyInfoIndex.ACTION);
final String actionVal = action.toUpperCase();
int atype = -1;
for (int i = 0; i < BwAlarm.alarmTypes.length; i++) {
if (actionVal.equals(BwAlarm.alarmTypes[i])) {
atype = i;
break;
}
}
if (atype < 0) {
alarm.setAlarmType(BwAlarm.alarmTypeOther);
alarm.addXproperty(BwXproperty.makeIcalProperty("ACTION", null, action));
} else {
alarm.setAlarmType(atype);
}
alarm.setTrigger(getString(PropertyInfoIndex.TRIGGER));
alarm.setTriggerDateTime(getBool(PropertyInfoIndex.TRIGGER_DATE_TIME));
final String rel = getString(ParameterInfoIndex.RELATED);
alarm.setTriggerStart(rel == null);
alarm.setDuration(getString(PropertyInfoIndex.DURATION));
alarm.setRepeat(getInt(PropertyInfoIndex.REPEAT));
if (atype == BwAlarm.alarmTypeAudio) {
alarm.setAttach(getString(PropertyInfoIndex.ATTACH));
} else if (atype == BwAlarm.alarmTypeDisplay) {
alarm.setDescription(getString(PropertyInfoIndex.DESCRIPTION));
} else if (atype == BwAlarm.alarmTypeEmail) {
alarm.setAttach(getString(PropertyInfoIndex.ATTACH));
alarm.setDescription(getString(PropertyInfoIndex.DESCRIPTION));
alarm.setSummary(getString(PropertyInfoIndex.SUMMARY));
alarm.setAttendees(restoreAttendees(false));
} else if (atype == BwAlarm.alarmTypeProcedure) {
alarm.setAttach(getString(PropertyInfoIndex.ATTACH));
alarm.setDescription(getString(PropertyInfoIndex.DESCRIPTION));
} else {
alarm.setDescription(getString(PropertyInfoIndex.DESCRIPTION));
}
alarm.setXproperties(restoreXprops());
alarms.add(alarm);
} catch (final IndexException ie) {
throw new CalFacadeException(ie);
} finally {
popFields();
}
}
return alarms;
}
use of org.bedework.util.indexing.IndexException in project bw-calendar-engine by Bedework.
the class EntityBuilder method restoreAttendees.
private Set<BwAttendee> restoreAttendees(final boolean vpoll) throws CalFacadeException {
final PropertyInfoIndex pi;
if (vpoll) {
pi = PropertyInfoIndex.VOTER;
} else {
pi = PropertyInfoIndex.ATTENDEE;
}
final List<Object> vals = getFieldValues(pi);
if (Util.isEmpty(vals)) {
return null;
}
final Set<BwAttendee> atts = new TreeSet<>();
for (final Object o : vals) {
try {
pushFields(o);
final BwAttendee att = new BwAttendee();
if (pushFields(PropertyInfoIndex.PARAMETERS)) {
try {
att.setRsvp(getBool(ParameterInfoIndex.RSVP));
att.setCn(getString(ParameterInfoIndex.CN));
att.setPartstat(getString(ParameterInfoIndex.PARTSTAT));
att.setScheduleStatus(getString(ParameterInfoIndex.SCHEDULE_STATUS));
att.setCuType(getString(ParameterInfoIndex.CUTYPE));
att.setDelegatedFrom(getString(ParameterInfoIndex.DELEGATED_FROM));
att.setDelegatedTo(getString(ParameterInfoIndex.DELEGATED_TO));
att.setDir(getString(ParameterInfoIndex.DIR));
att.setLanguage(getString(ParameterInfoIndex.LANGUAGE));
att.setMember(getString(ParameterInfoIndex.MEMBER));
att.setRole(getString(ParameterInfoIndex.ROLE));
att.setSentBy(getString(ParameterInfoIndex.SENT_BY));
if (vpoll) {
att.setStayInformed(getBool(ParameterInfoIndex.STAY_INFORMED));
}
} finally {
popFields();
}
}
att.setAttendeeUri(getString(PropertyInfoIndex.URI));
atts.add(att);
} catch (final IndexException ie) {
throw new CalFacadeException(ie);
} finally {
popFields();
}
}
return atts;
}
use of org.bedework.util.indexing.IndexException in project bw-calendar-engine by Bedework.
the class EntityBuilder method getUids.
private Set<String> getUids(final List<Object> vals) throws CalFacadeException {
if (Util.isEmpty(vals)) {
return null;
}
final Set<String> uids = new TreeSet<>();
for (final Object o : vals) {
try {
pushFields(o);
final String uid = getString(PropertyInfoIndex.UID);
uids.add(uid);
} catch (final IndexException ie) {
throw new CalFacadeException(ie);
} finally {
popFields();
}
}
return uids;
}
use of org.bedework.util.indexing.IndexException in project bw-calendar-engine by Bedework.
the class DocBuilder method makeBwDateTimes.
private void makeBwDateTimes(final PropertyInfoIndex pi, final Set<BwDateTime> vals) throws CalFacadeException {
try {
if (Util.isEmpty(vals)) {
return;
}
startArray(getJname(pi));
for (final BwDateTime dt : vals) {
indexDate(null, dt);
}
endArray();
} catch (final IndexException e) {
throw new CalFacadeException(e);
}
}
Aggregations