use of org.bedework.calfacade.exc.CalFacadeException in project bw-calendar-engine by Bedework.
the class DocBuilder method makeDoc.
/* Return the docinfo for the indexer */
EsDocInfo makeDoc(final BwCalendar col) throws CalFacadeException {
try {
final long version = col.getMicrosecsVersion();
startObject();
makeShareableContained(col);
makeField(PropertyInfoIndex.LAST_MODIFIED, col.getLastmod().getTimestamp());
makeField(PropertyInfoIndex.CREATED, col.getCreated());
// makeField(PropertyInfoIndex.VERSION, version);
makeField(PropertyInfoIndex.NAME, col.getName());
makeField(PropertyInfoIndex.HREF, col.getPath());
makeField(PropertyInfoIndex.SUMMARY, col.getSummary());
makeField(PropertyInfoIndex.DESCRIPTION, col.getDescription());
makeField(PropertyInfoIndex.AFFECTS_FREE_BUSY, col.getAffectsFreeBusy());
makeField(PropertyInfoIndex.ALIAS_URI, col.getAliasUri());
makeField(PropertyInfoIndex.CALTYPE, col.getCalType());
makeField(PropertyInfoIndex.DISPLAY, col.getDisplay());
makeField(PropertyInfoIndex.FILTER_EXPR, col.getFilterExpr());
makeField(PropertyInfoIndex.IGNORE_TRANSP, col.getIgnoreTransparency());
makeField(PropertyInfoIndex.LAST_REFRESH, col.getLastRefresh());
makeField(PropertyInfoIndex.LAST_REFRESH_STATUS, col.getLastRefreshStatus());
makeField(PropertyInfoIndex.REFRESH_RATE, col.getRefreshRate());
makeField(PropertyInfoIndex.REMOTE_ID, col.getRemoteId());
makeField(PropertyInfoIndex.REMOTE_PW, col.getRemotePw());
makeField(PropertyInfoIndex.UNREMOVEABLE, col.getUnremoveable());
// mailListId
indexProperties(col.getProperties());
indexCategories(col.getCategories());
endObject();
return makeDocInfo(BwIndexer.docTypeCollection, version, col.getPath());
} catch (final CalFacadeException cfe) {
throw cfe;
} catch (final Throwable t) {
throw new CalFacadeException(t);
}
}
use of org.bedework.calfacade.exc.CalFacadeException in project bw-calendar-engine by Bedework.
the class DocBuilder method indexGeo.
private void indexGeo(final BwGeo val) throws CalFacadeException {
try {
if (val == null) {
return;
}
startObject(getJname(PropertyInfoIndex.GEO));
makeField("lat", val.getLatitude().toPlainString());
makeField("lon", val.getLongitude().toPlainString());
endObject();
} catch (final IndexException e) {
throw new CalFacadeException(e);
}
}
use of org.bedework.calfacade.exc.CalFacadeException in project bw-calendar-engine by Bedework.
the class DocBuilder method makeDoc.
/* Return the docinfo for the indexer */
EsDocInfo makeDoc(final BwCategory ent) throws CalFacadeException {
try {
/* We don't have real collections. It's been the practice to
create "/" delimited names to emulate a hierarchy. Look out
for these and try to create a real path based on them.
*/
ent.fixNames(basicSysprops, principal);
startObject();
makeShareableContained(ent);
makeField(PropertyInfoIndex.NAME, ent.getName());
makeField(PropertyInfoIndex.UID, ent.getUid());
makeField(PropertyInfoIndex.HREF, ent.getHref());
makeField(PropertyInfoIndex.CATEGORIES, ent.getWord());
makeField(PropertyInfoIndex.DESCRIPTION, ent.getDescription());
endObject();
return makeDocInfo(BwIndexer.docTypeCategory, 0, ent.getHref());
} catch (final CalFacadeException cfe) {
throw cfe;
} catch (final Throwable t) {
throw new CalFacadeException(t);
}
}
use of org.bedework.calfacade.exc.CalFacadeException in project bw-calendar-engine by Bedework.
the class DocBuilder method indexXprops.
private void indexXprops(final XpropsEntity ent) throws CalFacadeException {
try {
if (Util.isEmpty(ent.getXproperties())) {
return;
}
/* First output ones we know about with our own name */
for (final String nm : interestingXprops.keySet()) {
final List<BwXproperty> props = ent.getXproperties(nm);
if (Util.isEmpty(props)) {
continue;
}
startArray(interestingXprops.get(nm));
for (final BwXproperty xp : props) {
if (xp.getName().equals(BwXproperty.bedeworkSuggestedTo)) {
final String val = xp.getValue();
// Find the second ":" delimiter
final int pos = val.indexOf(":", 2);
if (pos < 0) {
// Bad value
continue;
}
value(val.substring(0, pos));
continue;
}
String pars = xp.getPars();
if (pars == null) {
pars = "";
}
value(pars + "\t" + xp.getValue());
}
endArray();
}
/* Now ones we don't know or care about */
startArray(getJname(PropertyInfoIndex.XPROP));
for (final BwXproperty xp : ent.getXproperties()) {
final String nm = interestingXprops.get(xp.getName());
if (nm != null) {
continue;
}
startObject();
makeField(PropertyInfoIndex.NAME, xp.getName());
if (xp.getPars() != null) {
makeField(getJname(PropertyInfoIndex.PARAMETERS), xp.getPars());
}
makeField(getJname(PropertyInfoIndex.VALUE), xp.getValue());
endObject();
}
endArray();
} catch (final IndexException e) {
throw new CalFacadeException(e);
}
}
use of org.bedework.calfacade.exc.CalFacadeException in project bw-calendar-engine by Bedework.
the class DocBuilder method indexProperties.
private void indexProperties(final Set<BwProperty> props) throws CalFacadeException {
if (props == null) {
return;
}
try {
startArray(getJname(PropertyInfoIndex.COL_PROPERTIES));
for (final BwProperty prop : props) {
startObject();
makeField(PropertyInfoIndex.NAME, prop.getName());
makeField(PropertyInfoIndex.VALUE, prop.getValue());
endObject();
}
endArray();
} catch (final IndexException e) {
throw new CalFacadeException(e);
}
}
Aggregations