use of org.bedework.util.indexing.IndexException in project bw-calendar-engine by Bedework.
the class EntityBuilder method restoreBwStringSet.
private Set<? extends BwStringBase> restoreBwStringSet(final PropertyInfoIndex pi, final boolean longStrings) throws CalFacadeException {
final List<Object> vals = getFieldValues(pi);
if (Util.isEmpty(vals)) {
return null;
}
final Set<BwStringBase> ss = new TreeSet<>();
for (final Object o : vals) {
try {
pushFields(o);
ss.add(restoreBwString(longStrings));
} catch (final IndexException ie) {
throw new CalFacadeException(ie);
} finally {
popFields();
}
}
return ss;
}
use of org.bedework.util.indexing.IndexException in project bw-calendar-engine by Bedework.
the class EntityBuilder method restoreXprops.
private List<BwXproperty> restoreXprops() throws CalFacadeException {
/* Convert our special fields back to xprops */
final Set<String> xpnames = DocBuilder.interestingXprops.keySet();
final List<BwXproperty> xprops = new ArrayList<>();
if (!Util.isEmpty(xpnames)) {
for (final String xpname : xpnames) {
@SuppressWarnings("unchecked") final Collection<String> xvals = (Collection) getFieldValues(DocBuilder.interestingXprops.get(xpname));
if (!Util.isEmpty(xvals)) {
for (final String xval : xvals) {
final int pos = xval.indexOf("\t");
String pars = null;
if (pos > 0) {
pars = xval.substring(0, pos);
}
final BwXproperty xp = new BwXproperty(xpname, pars, xval.substring(pos + 1));
xprops.add(xp);
}
}
}
}
/* Now restore the rest of the xprops */
final List<Object> xpropFields = getFieldValues(PropertyInfoIndex.XPROP);
if (Util.isEmpty(xpropFields)) {
return xprops;
}
for (final Object o : xpropFields) {
try {
pushFields(o);
final BwXproperty xp = new BwXproperty();
xp.setName(getString(PropertyInfoIndex.NAME));
xp.setPars(getString(PropertyInfoIndex.PARAMETERS));
xp.setValue(getString(PropertyInfoIndex.VALUE));
xprops.add(xp);
} catch (final IndexException ie) {
throw new CalFacadeException(ie);
} finally {
popFields();
}
}
return xprops;
}
use of org.bedework.util.indexing.IndexException in project bw-calendar-engine by Bedework.
the class EntityBuilder method restoreProperties.
private void restoreProperties(final BwCalendar col) throws CalFacadeException {
final Collection<Object> vals = getFieldValues(PropertyInfoIndex.COL_PROPERTIES);
if (Util.isEmpty(vals)) {
return;
}
final Set<BwProperty> props = new TreeSet<>();
for (final Object o : vals) {
try {
pushFields(o);
final String name = getString(PropertyInfoIndex.NAME);
final String val = getString(PropertyInfoIndex.VALUE);
props.add(new BwProperty(name, val));
} catch (final IndexException ie) {
throw new CalFacadeException(ie);
} finally {
popFields();
}
}
col.setProperties(props);
}
Aggregations